我已将 Bind 设置为我的 Intranet DNS 解析服务(在 Ubuntu 16.04.02 LTS 上运行)。
我想要实现的目标: 拥有指向服务器的公共域名(例如:domain.com -> 1.2.3.4)使用指向内部机器的相同子域名(例如:machine1.domain.com -> 192.168。 1.100)
我所做的:(配置)
文件:/etc/bind/named.conf.options
options {
directory "/var/cache/bind";
recursion yes;
allow-recursion { 192.168.2.0/24; };
listen-on {192.168.2.4; };
allow-transfer { none; };
forwarders {
192.168.2.1; #router
8.8.8.8; #public dns
};
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
acl "truested" {
192.168.2.0/24;
192.168.2.4; # ns1
192.168.2.5; # ns2
};
Run Code Online (Sandbox Code Playgroud)
文件:/etc/bind/named.conf.local
zone "domain.com" {
type master;
file "/etc/bind/zones/db.domain.com";
allow-transfer { …Run Code Online (Sandbox Code Playgroud)