配置内部DNS
Debian 9
bind 9
named.conf.default-zones文件无效化
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
// include "/etc/bind/named.conf.default-zones";
view "internal"{
match-clients {
localhost;
192.168.0.0/16;
};
zone "fugafuga.info" {
type master;
file "/etc/bind/fugafuga.info.internal-zone";
};
zone "hogehoge.com" {
type master;
file "/etc/bind/hogehoge.com.internal-zone";
};
zone "168.192.in-addr.arpa" {
type master;
file "/etc/bind/168.192.in-addr.arpa.zone";
};
};
使用view,一部分客户被提供DNS。"matchclients"设置那个客户。
$TTL 3600
@ IN SOA hogehoge.com. hogehogemail.com.(
20180723 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS fugafuga.info.
hogehoge.com. IN A 192.168.11.200
Time To Live - 生存时间
在SOA的后面写域名和电子邮件地址。
设置DNS服务器。
设置域名和IP地址。
$TTL 3600
@ IN SOA fugafuga.info. hogehogemail.com.(
20180723 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS fugafuga.info.
fugafuga.info. IN A 192.168.11.205
$TTL 3600
@ IN SOA fugafuga.info. hogehogemail.com.(
20180723 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS fugafuga.info.
11.200 IN PTR hogehoge.com.
11.205 IN PTR fugafuga.info.
设置IP地址和域名。
用named-checkconf命令检查configuration file和zone file。
$ /usr/sbin/named-checkconf
$ /usr/sbin/named-checkconf -z
zone fugafuga.info/IN: loaded serial 20180723
zone hogehoge.com/IN: loaded serial 20180723
zone 168.192.in-addr.arpa/IN: loaded serial 20180723
$ sudo service bind9 restart
$ sudo vim /etc/network/interfaces
(中略)
dns-nameservers 192.168.11.205 8.8.8.8
(中略)
sudo ifdown enp3s0
sudo ifup enp3s0
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。