fre*_*wra 0 domain-name-system bind
我正在创建一个本地网络绑定服务器。
我写了这个配置文件
/etc/bind/named.conf.local
include "/etc/bind/zones.rfc1918";
acl localnet {
192.168.1.0/24;
127.0.0.0/8;
};
zone "example.local" {
type master;
file "/etc/bind/db.example.local";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.192.168.1";
};
Run Code Online (Sandbox Code Playgroud)
/etc/bind/db.example.local
$TTL 3600
@ IN SOA ns.example.local. dns01.example.local. (
2007112701; Serial
3600; Refresh
86400; Retry
2419200; Expire
3600 ); Negative Cache TTL
;
IN NS ns.example.local
IN MX 10 mail01.example.local
@ IN A 192.168.1.108
dns01 IN A 192.168.1.108
ns IN CNAME dns01
gateway IN A 192.168.1.1
Run Code Online (Sandbox Code Playgroud)
/etc/bind/db.192.168.1
$TTL 3600
@ IN SOA ns.example.local. dns01.example.local. (
2007112702; Serial
3600; Refresh
86400; Retry
2419200; Expire
3600 ); Negative Cache TTL
;
IN NS ns.example.local.
200 IN PTR dns01.example.local.
1 IN PTR gateway.example.local.
Run Code Online (Sandbox Code Playgroud)
然后 /etc/init.d/bind9 重新启动和 /etc/resolv.conf
domain example.local
nameserver 192.168.1.108
$ nslookup dns01
Server: 192.168.1.108
Address: 192.168.1.108#53
Name: dns01.example.local
Address: 192.168.1.108
$ nslookup dns01
Server: 192.168.1.108
Address: 192.168.1.108#53
Name: dns01.example.local
Address: 192.168.1.108
$ nslookup 192.168.1.108
Server: 192.168.1.108
Address: 192.168.1.108#53
** server can't find 108.1.168.192.in-addr.arpa.: NXDOMAIN [#id7e65d6]
Run Code Online (Sandbox Code Playgroud)
怎么了?
the*_*ive 12
那是你完整的 /etc/bind/db.192.168.1,因为它不包括 108 的条目。
$TTL 3600
1.168.192.IN-ADDR.ARPA IN SOA ns.example.local. dns01.example.local. (
2007112702; Serial
3600; Refresh
86400; Retry
2419200; Expire
3600 ); Negative Cache TTL
IN NS ns.example.local.
$ORIGIN 1.168.192.IN-ADDR.ARPA.
108 IN PTR dns01.example.local.
1 IN PTR gateway.example.local.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4407 次 |
| 最近记录: |