[root@centos7 ~]# vi /var/named/chroot/etc/named.conf
.. .. zone "example.local" { type master; file "example.local.zone"; }; zone "0.168.192.in-addr.arpa" IN { type master; file "192.168.0.zone"; }; .. ..
; ; Addresses and other host information. ; $TTL 86400 @ IN SOA example.local. hostmaster.example.local. ( 2014101901 ; Serial 43200 ; Refresh 3600 ; Retry 3600000 ; Expire 2592000 ) ; Minimum ; Define the nameservers and the mail servers IN NS ns1.example.local. IN NS ns2.example.local. IN A 192.168.0.70 IN MX 10 mx.example.local. centos7 IN A 192.168.0.70 mx IN A 192.168.0.50 ns1 IN A 192.168.0.70 ns2 IN A 192.168.0.80
b)创建反向域
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[root@centos7 ~]# vi /var/named/chroot/var/named/192.168.0.zone
; ; Addresses and other host information. ; $TTL 86400 @ IN SOA example.local. hostmaster.example.local. ( 2014101901 ; Serial 43200 ; Refresh 3600 ; Retry 3600000 ; Expire 2592000 ) ; Minimum 0.168.192.in-addr.arpa. IN NS centos7.example.local. 70.0.168.192.in-addr.arpa. IN PTR mx.example.local. 70.0.168.192.in-addr.arpa. IN PTR ns1.example.local. 80.0.168.192.in-addr.arpa. IN PTR ns2.example.local.
8、开机自启动 bind-chroot 服务
1 2 3 4 5 6
[root@centos7 ~]# /usr/libexec/setup-named-chroot.sh /var/named/chroot on [root@centos7 ~]# systemctl stop named [root@centos7 ~]# systemctl disable named [root@centos7 ~]# systemctl start named-chroot [root@centos7 ~]# systemctl enable named-chroot ln -s '/usr/lib/systemd/system/named-chroot.service' '/etc/systemd/system/multi-user.target.wants/named-chroot.service'