DNS解析 問題 請教
各位 ,我在 linux下 配置DNS后使用nslookup測試
server 127.0.0.1后 可以正常解析
但選擇server 192.168.13.1(本機DNS伺服器地址)后查詢就不可以 提示連接不到 配置文件和測試信息 如下,請 幫幫忙看看
named.conf:
options {
listen-on port 53 { any; };
//listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
allow-query { any; };
allow-query-cache { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
zone "." IN {
type hint;
file "named.ca";
};
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
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.ip6.arpa" IN {
type master;
file "named.ip6.local";
allow-update { none; };
};
zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
zone "test.com" IN {
type master;
file "test.com.zone";
allow-update { none; };
};
zone "13.168.192.in-addr.arpa" IN {
type master;
file "test.com.rev";
allow-update { none; };
};
};
test.com.zone正向解析文件
$TTL 86400
@ IN SOA dns1.test.com. root.test.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS dns1.test.com.
IN NS dns2.test.com.
IN MX 5 mail.test.com.
dns1 IN A 192.168.13.1
dns1 IN A 192.168.13.2
www IN CNAME dns1.test.com.
ftp IN CNAME dns2.test.com.
mail IN CNAME dns2.test.com.
test.com.rev反向解析文件
$TTL 86400
@ IN SOA dns1.test.com. root.test.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR dns1.test.com.
1 IN PTR www.test.com.
2 IN PTR dns2.test.com.
2 IN PTR ftp.test.com.
測試信息
# nslookup
> server 127.0.0.1
Default server: 127.0.0.1
Address: 127.0.0.1#53
> www.test.com
Server: 127.0.0.1
Address: 127.0.0.1#53
www.test.com canonical name = dns1.test.com.
Name: dns1.test.com
Address: 192.168.13.1
Name: dns1.test.com
Address: 192.168.13.2
> 192.168.13.1
Server: 127.0.0.1
Address: 127.0.0.1#53
1.13.168.192.in-addr.arpa name = dns1.test.com.
1.13.168.192.in-addr.arpa name = www.test.com.
> server 192.168.13.1
Default server: 192.168.13.1
Address: 192.168.13.1#53
> www.test.com
;; connection timed out; no servers could be reached
> 192.168.13.1
;; connection timed out; no servers could be reached
>
《解決方案》
頂一下:dizzy:
《解決方案》
IN NS dns1.test.com.
IN NS dns2.test.com.
IN MX 5 mail.test.com.
dns1 IN A 192.168.13.1
dns1 IN A 192.168.13.2
《解決方案》
dns2在哪裡?本機ip是多少?netstat -tunl有監聽所有地址?
還是換dig命令吧,別用nslookup了