1、安装 named

2、配置如下文件:

/etc/named.conf

//
2 // named.conf
3 //
4 // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
5 // server as a caching only nameserver (as a localhost DNS resolver only).
6 //
7 // See /usr/share/doc/bind*/sample/ for example named configuration files.
8 //
9
10 options {
11 listen-on port 53 { any; };
12 //listen-on-v6 port 53 { ::1; };
13 directory "/var/named";
14 dump-file "/var/named/data/cache_dump.db";
15 statistics-file "/var/named/data/named_stats.txt";
16 memstatistics-file "/var/named/data/named_mem_stats.txt";
17 allow-query { any; };
18 recursion yes;
19
20 dnssec-enable yes;
21 dnssec-validation yes;
22 dnssec-lookaside auto; 24 /* Path to ISC DLV key */
25 bindkeys-file "/etc/named.iscdlv.key";
26
27 managed-keys-directory "/var/named/dynamic";
28 };
29
30 logging {
31 channel default_debug {
32 file "data/named.run";
33 severity dynamic;
34 };
35 };
36
37 zone "." IN {
38 type hint;
39 file "named.ca";
40 };
41
42 include "/etc/named.rfc1912.zones";
43 include "/etc/named.root.key";
44

/etc/namd.rfc1912/zones

// named.rfc1912.zones:
2 //
3 // Provided by Red Hat caching-nameserver package
4 //
5 // ISC BIND named zone configuration for zones recommended by
6 // RFC 1912 section 4.1 : localhost TLDs and address zones
7 // and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zo nes-02.txt
8 // (c)2007 R W Franks
9 //
10 // See /usr/share/doc/bind*/sample/ for example named configuration files.
11 //
12
13 zone "917.cs" IN {
14 type master;
15 file "123.cs.zone";
16 };
17
18 zone "1.168.192.in-addr.arpa" IN {
19 type master;
20 file "1.168.192.zone";
21 };
22
23 zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.ar pa" IN {
24 type master;
25 file "named.loopback";
26 allow-update { none; };
27 };
28
29 zone "1.0.0.127.in-addr.arpa" IN {
30 type master;
31 file "named.loopback";
32 allow-update { none; };
33 };
34
35 zone "0.in-addr.arpa" IN {
36 type master;
37 file "named.empty";
38 allow-update { none; };
39 };
40

  反向解析

/var/named/1.168.192.zone
1 $TTL 86400
2 @ IN SOA ns.123.cs. root.123.cs (
3 12 ; serial
4 28800 ; refresh
5 14400 ; retry
6 3600000 ; expire
7 86400 ) ; minimum
8 @ IN NS ns.123.cs.
9 249 IN PTR mail.123.cs.
10 249 IN PTR ns.123.cs.
11 230 IN PTR img.123.cs

  正向解析

/var/named/123.cs.zone
1 $TTL 86400
2 @ IN SOA ns.123.cs. root.123.cs (
3 1 ; serial
4 1D ; refresh
5 1H ; retry
6 1W ; expire
7 3H ) ; minimum
8 @ IN NS ns.123.cs.
9 @ IN MX 5 mail.123.cs.
10 ns IN A 192.168.1.249
11 www IN A 192.168.1.230
12 mail IN A 192.168.1.249
13 img IN A 192.168.1.230
25 pop3 IN CNAME mail
26 smtp IN CNAME mail

  

启动:service named start

修改pc机 dns

vim /etc/resolv.conf

dns 服务器配置的更多相关文章

  1. DNS服务器配置实践

    实验背景:在Linux系统上配置主要DNS服务器和辅助DNS服务器,所在域名为example.com,子网为192.168.X.0. 启动已安装LINUX系统,进行DNS服务器配置. 一.配置主要DN ...

  2. Linux DNS 服务器配置与管理

    一.环境介绍: 运行软件:VMware Workstation Pro 14 系统环境:CentOS-7-x86_64-1810 二.操作配置: 1.基础知识简介 (1)域名空间 域和域名: DNS树 ...

  3. redhat7.3 dns服务器配置

    1.基本配置 systemctl stop firewalld.service systemctl disable firewalld.service setenforce 0 nmcli conne ...

  4. rndc控制远程dns服务器配置方法

    1- 如果不存在/etc/rndc.conf touch /etc/rndc.conf chown named:named /etc/rndc.conf 2- rndc-confgen > /e ...

  5. DNS服务器配置

    导读 DNS(Domain Name Server,域名服务器)是进行域名(domain name)和与之相对应的IP地址 (IP address)转换的服务器.DNS中保存了一张域名(domain ...

  6. [Ubuntu] Ubuntu DNS服务器配置

    服务器IP:10.68.19.61 操作系统:Ubuntu 13.04 DNS程序:Bind9 测试域名:mycloud.com 目标IP:10.68.19.134 配置步骤 1.安装BIND9程序包 ...

  7. Linux下DNS服务器配置

    一步:yum install -y bind bind-utils bind-chroot yum install bind* //安装DNS服务 第二步:systemctl stop firewal ...

  8. linux——DNS服务器配置

    讲课,请不要在课堂上查找文件,浏览器搜索,会感觉你很不上心,玩听众,一定提前做很多遍,模拟很多遍: 演讲,请务必准备好材料,考虑听众的感受,一定不要让外行人云里雾里,听不懂你在讲什么,那就尴尬了, D ...

  9. [Linux系列]DNS系列理论笔记与DNS服务器配置

    0x01 基础术语 DNS(Domain Name System,域名系统),域名和IP地址相互映射的一个分布式数据库,简而言之就是通过更易记忆的域名代替IP去访问一个网站. FQDN(Fully Q ...

随机推荐

  1. yii 隐藏index.php

    首先,开启apache的rewrite模块 去掉rewrite前的#,如下所示 LoadModule rewrite_module modules/mod_rewrite.so 接着,在yii的ind ...

  2. ajax 向后台传对象

    $.ajax({ url : "accreditSurveyInfo.action", data : $("form").serialize(), dataTy ...

  3. 互联网保险O2O平台微服务架构设计(转)

    非常感谢http://www.cnblogs.com/skyblog/p/5044486.html 关于架构,笔者认为并不是越复杂越好,而是相反,简单就是硬道理也提现在这里.这也是微服务能够流行的原因 ...

  4. python xlrd和xlwtxlutils包的使用

    安装xlrd读取模块 首先去官网或者pypi下载安装包,然后解压到任意目录 在dos下进入该目录,执行python setup.py install安装 验证成功进入python,执行import 包 ...

  5. VMDK镜像迁移到KVM

    The vmware system consists of two disks in raw format: the old boot disk and the second one. It is W ...

  6. zBoot/Makefile

    #上层makefile调用执行make命令,执行的应该是第一个目标allHEAD = head.oSYSTEM = ../tools/zSystem#LD = gcc#TEST = -DTEST_DR ...

  7. Apache使用mod_deflate模块压缩页面优化传输速度

    可以写为一行,也可以写多行,默认为gzip SetOutputFilter DEFLATE # Restrict compression to these MIME types AddOutputFi ...

  8. Codeforces Round #134 (Div. 2)

    A. Mountain Scenery 枚举山顶位置,满足\(r_{i-1} \lt r_i - 1 \gt r_{i+1}\). 范围要开\(2N\). B. Airport 优先队列维护最值. C ...

  9. ed编辑器使用

    evilxr@IdeaPad:/tmp$ ed aa.c 0 a enter another words hello nice www.evilxr.com . w aa.c 46 q a 表示添加内 ...

  10. UVA11324 强连通+dp记忆化搜索

    题意:对于一个有向图,问最大团中有多少点,要求该点集内所有点对间至少有一条路径(u到v或v到u或两条都有). 首先,对于每一个强连通分量,其中的所有点必然能够互相到达,所以先进行缩点,然后对于缩点后的 ...