1.yum install -y bind
2.systemctl enable named
3.systemctl start named
4.cp /etc/named.conf /etc/named.conf.bak
5.chown -R named:named /var/named/
6.编辑配置文件,vim /etc/named.conf;vim /etc/named.rfc1912.zones;vim /var/named/abc.xyz.zone
/etc/named.conf
allow-query { 192.168.0.0/24; };
forwarders {114.114.114.114;61.177.7.1;};
dnssec-enable no;
dnssec-validation no;
dnssec-lookaside auto;
/etc/named.rfc1912.zones
zone “abc.xyz” IN {
type master;
file “abc.xyz.zone”;
allow-query{any;};
};
/var/named/abc.xyz.zone
$TTL 1D
@ IN SOA @ abc.xyz. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ; minimumq
);
IN NS abc.xyz.
abc.xyz. IN A 192.168.0.200
api.abc.xyz. IN A 192.168.0.200