1、安装bind相关的包
#yum install bind-* -y
把原来的配置文件重命名,不使用它
# mv /etc/named.conf /etc/named.conf.default
# vim /etc/named.conf
options {
directory "/var/named";
};
zone "svvip.net." IN {
type master;
file "data/master.svvip.net.zone";
};
zone "122.168.192.in-addr.arpa" IN {
type master;
file "data/122.168.192.in-addr.arpa";
};
# vim /var/named/data/master.svvip.net.zone
$TTL 86400
@ IN SOA svvip.net. admin.(
2015121701
1D
1H
1W
3H)
@ IN NS ns1.svvip.net.
ns1 IN A 192.168.122.2
dns-cobbler IN CNAME ns1
server IN A 192.168.122.1
zabbix IN A 192.168.122.3
puppet IN A 192.168.122.4
$GENERATE 5-200 agent$ IN A 192.168.122.$
# vim /var/named/data/122.168.192.in-addr.arpa
$TTL 86400
@ IN SOA 122.168.192.in-addr.arpa admin. ( 2015121701
1D
1H
1W
3H)
@ IN NS ns1.svvip.net.
2 IN PTR ns1.svvip.net.
1 IN PTR server.svvip.net.
3 IN PTR zabbix.svvip.net.
4 IN PTR puppet.svvip.net.
$GENERATE 5-200 $ IN PTR agent$.svvip.net.
检测配置文件和区域文件是否正确
# named-checkconf /etc/named.conf
# named-checkzone svvip.net /var/named/data/master.svvip.net.zone
zone svvip.net/IN: loaded serial 2015121701
OK
# named-checkzone 122.168.192.in-addr.arpa /var/named/data/122.168.192.in-addr.arpa
zone 122.168.192.in-addr.arpa/IN: loaded serial 2015121701
OK
启动服务
el6启动方式:service named start
el6设置开机启动: chkconfig named on
el7启动方式:systemctl start named.service
el7设置开机启动: systemctl enable named.service