yum -y install bind bind-utils
service named start
vi /etc/named.conf 修改any
service named restart
netstat -antlpe | grep named
# 验证配置文件是否有错误
named-checkzone test.com /var/named/test.com.zone
本地配置 dns
vi /etc/resolv.conf
# Generated by NetworkManager
nameserver 172.16.30.28
nameserver 202.96.202.5
nameserver 114.114.114.114
cd /var/named/ cp -p named.localhost named.inner
demo hk.com
$TTL 1D
@ IN SOA dns.hk.com. root.hk.com. (
0 ; serial
1H ; refresh
1H ; retry
1H ; expire
1H ) ; minimum
NS dns.hk.com.
dns A 172.16.30.11
www A 172.16.30.22
news A 172.16.30.33
vi /var/named/named.inner
$TTL 1D
@ IN SOA @ root.inner.test.tianshengcm.com. (
0 ; serial
1H ; refresh
1H ; retry
1H ; expire
1H ) ; minimum
IN NS @
IN A 172.16.30.28
@ IN A 172.16.30.28
ynh-app IN A 172.16.30.28
ynh-rcm IN A 172.16.30.28
ynh-cs IN A 172.16.30.28
fhh-app IN A 172.16.30.28
fhh-rcm IN A 172.16.30.28
fhh-cs IN A 172.16.30.28
* IN A 172.16.30.28
追加 vi /etc/named.rfc1912.zones
zone "hk.com" IN {
type master;
file "hk.com";
allow-update { none; };
};
zone "inner.test.tianshengcm.com" IN {
type master;
file "named.inner";
allow-update { none; };
};
dig inner.test.tianshengcm.com