#yum -y install bind*
[root@test1 ~]# cat /etc/hosts
127.0.0.1 test1.yundasys.com
10.26.100.10test1.yundasys.com
[root@test1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
PEERDNS=no
[root@test1 ~]# cat /etc/nsswitch.conf
hosts: files dns
[root@test1 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search yundasys.com
#nameserver 202.103.24.68
#nameserver 202.103.44.150
nameserver 10.26.100.10
#vim /etc/named.conf
options {
listen-on port 53 { 10.26.100.10; };
allow-query { any; };
allow-transfer { none; };
}
zone "yundasys.com" IN
{
type master;
file "test1.yundasys.com.zone";
};
zone "100.26.10.in-addr.arpa" IN
{
type master;
file "test1.10.26.100.zone";
};
#cp -a named.localhost test1.yundasys.com.zone
#cp -a named.localhost test1.10.26.100.zone
[root@test1 ~]# cat /var/named/test1.yundasys.com.zone
$TTL 1D
@IN SOAtest1.yundasys.com. root.test1.yundasys.com. (
0; serial
1D; refresh
1H; retry
1W; expire
3H ); minimum
@INNStest1.yundasys.com.
test1.yundasys.com.INA10.26.100.10
[root@test1 ~]# cat /var/named/test1.10.26.100.zone
$TTL 1D
@IN SOA test1.yundasys.com. root.test1.yundasys.com. (
0; serial
1D; refresh
1H; retry
1W; expire
3H ); minimum
@INNStest1.yundasys.com.
10INPTRtest1.yundasys.com.
#named-checkconf
#named-checkzone tes1.yundasys.com /var/named/test1.yundasys.com.zone
[root@test1 ~]# named-checkzone tes1.10.26.100 /var/named/test1.10.26.100.zone
zone tes1.10.26.100/IN: loaded serial 0
OK
#service named start
[root@test1 ~]# nslookup
> 10.26.100.10
Server:10.26.100.10
Address:10.26.100.10#53
10.100.26.10.in-addr.arpaname = test1.yundasys.com.
> test1.yundasys.com
Server:10.26.100.10
Address:10.26.100.10#53
Name:test1.yundasys.com
Address: 10.26.100.10
参考资料http://linux.vbird.org/linux_server/0350dns.PHP#DNS_master_rr_re
原文链接:https://www.f2er.com/centos/375314.html