有人能解释一下这个问题吗,我似乎无法解析我的域名foo.com
root@dns:/etc/bind/zones# nslookup foo.com
Server: 192.168.1.54
Address: 192.168.1.54#53
*** Can't find foo.com: No answer
我的前向区域文件
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.foo.com. admin.foo.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.foo.com.
ns IN A 192.168.1.54
;also list other computers
www IN A 192.168.1.54
我的系统日志文件
Jun 10 23:20:57 zild-ubuntu named[13703]: starting BIND 9.8.1-P1 -u bind
Jun 10 23:20:57 zild-ubuntu named[13703]: built with '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc/bind' '--localstatedir=/var' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--enable-static' '--with-openssl=/usr' '--with-gssapi=/usr' '--with-gnu-ld' '--with-geoip=/usr' '--enable-ipv6' 'CFLAGS=-fno-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'
Jun 10 23:20:57 zild-ubuntu named[13703]: adjusted limit on open files from 4096 to 1048576
Jun 10 23:20:57 zild-ubuntu named[13703]: found 1 CPU, using 1 worker thread
Jun 10 23:20:57 zild-ubuntu named[13703]: using up to 4096 sockets
Jun 10 23:20:57 zild-ubuntu named[13703]: loading configuration from '/etc/bind/named.conf'
Jun 10 23:20:57 zild-ubuntu named[13703]: reading built-in trusted keys from file '/etc/bind/bind.keys'
Jun 10 23:20:57 zild-ubuntu named[13703]: using default UDP/IPv4 port range: [1024, 65535]
Jun 10 23:20:57 zild-ubuntu named[13703]: using default UDP/IPv6 port range: [1024, 65535]
Jun 10 23:20:57 zild-ubuntu named[13703]: listening on IPv6 interfaces, port 53
Jun 10 23:20:58 zild-ubuntu named[13703]: listening on IPv4 interface lo, 127.0.0.1#53
Jun 10 23:20:58 zild-ubuntu named[13703]: listening on IPv4 interface eth0, 192.168.1.54#53
Jun 10 23:20:58 zild-ubuntu named[13703]: generating session key for dynamic DNS
Jun 10 23:20:58 zild-ubuntu named[13703]: sizing zone task pool based on 7 zones
Jun 10 23:20:58 zild-ubuntu named[13703]: using built-in root key for view _default
Jun 10 23:20:58 zild-ubuntu named[13703]: set up managed keys zone for view _default, file 'managed-keys.bind'
Jun 10 23:20:58 zild-ubuntu named[13703]: Warning: 'empty-zones-enable/disable-empty-zone' not set: disabling RFC 1918 empty zones
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: 254.169.IN-ADDR.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: 2.0.192.IN-ADDR.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: 100.51.198.IN-ADDR.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: 113.0.203.IN-ADDR.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: 255.255.255.255.IN-ADDR.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: D.F.IP6.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: 8.E.F.IP6.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: 9.E.F.IP6.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: A.E.F.IP6.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: B.E.F.IP6.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA
Jun 10 23:20:58 zild-ubuntu named[13703]: command channel listening on 127.0.0.1#953
Jun 10 23:20:58 zild-ubuntu named[13703]: command channel listening on ::1#953
Jun 10 23:20:58 zild-ubuntu named[13703]: zone 0.in-addr.arpa/IN: loaded serial 1
Jun 10 23:20:58 zild-ubuntu named[13703]: zone 127.in-addr.arpa/IN: loaded serial 1
Jun 10 23:20:58 zild-ubuntu named[13703]: zone 1.168.192.in-addr.arpa/IN: loaded serial 2
Jun 10 23:20:58 zild-ubuntu named[13703]: zone 255.in-addr.arpa/IN: loaded serial 1
Jun 10 23:20:58 zild-ubuntu named[13703]: zone foo.com/IN: loaded serial 1
Jun 10 23:20:58 zild-ubuntu named[13703]: zone localhost/IN: loaded serial 2
Jun 10 23:20:58 zild-ubuntu named[13703]: managed-keys-zone ./IN: loaded serial 2
Jun 10 23:20:58 zild-ubuntu named[13703]: running
Jun 10 23:20:58 zild-ubuntu named[13703]: zone 1.168.192.in-addr.arpa/IN: sending notifies (serial 2)
你可以看到这里foo.com
已经加载了。并且我的/etc/resolv.conf
也已经配置为nameserver 127.0.0.1
Jun 10 23:20:58 zild-ubuntu named[13703]: zone foo.com/IN: loaded serial 1
答案1
您没有 的 A 记录foo.com
,您只有 的 A 记录www.foo.com
。
尝试使用 www.foo.com 进行挖掘或添加@ IN A 192.168.1.54
到区域文件。