防火墙已经关闭,selinux也disable掉了
配置完DNS服务器后,DNS服务器将自己设置为DNS可以正常解析域名,
但是客户端却无法解析。测试的工具使用的是nslookup。
为什么呢?
8 个解决方案
#1
我把配置文件贴一下吧
named.caching-nameserver.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";
memstatistics-file "/var/named/data/named_mem_stats.txt";
query-source port 53;
query-source-v6 port 53;
allow-query { any; };
forwarders {192.168.1.10;};
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
named.caching-nameserver.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";
memstatistics-file "/var/named/data/named_mem_stats.txt";
query-source port 53;
query-source-v6 port 53;
allow-query { any; };
forwarders {192.168.1.10;};
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
#2
named.rfc1912.zones的配置
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 "dzs.sc" IN{
type master;
file "dzs.sc.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 "." 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 "dzs.sc" IN{
type master;
file "dzs.sc.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; };
};
#3
dzs.sc.zone的配置
$TTL 86400 @ IN SOA OA. hostmaster.
(42 ; serial (d. adams)
3H ;efresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS OA.
www IN A 192.168.192.16
jwzh IN A 192.168.192.10
jwzh IN A 192.168.192.18
oa IN A 192.168.192.16
zhcx IN A 192.168.192.87
oa.kj.dzs.sc. IN A 192.168.218.8
www.jt.dzs.sc. IN A 192.168.199.12
mail.gaj.dzs.sc. IN A 192.168.192.9
gaj.dzs.sc. IN MX 10 mail.gaj.dzs.sc.
$TTL 86400 @ IN SOA OA. hostmaster.
(42 ; serial (d. adams)
3H ;efresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS OA.
www IN A 192.168.192.16
jwzh IN A 192.168.192.10
jwzh IN A 192.168.192.18
oa IN A 192.168.192.16
zhcx IN A 192.168.192.87
oa.kj.dzs.sc. IN A 192.168.218.8
www.jt.dzs.sc. IN A 192.168.199.12
mail.gaj.dzs.sc. IN A 192.168.192.9
gaj.dzs.sc. IN MX 10 mail.gaj.dzs.sc.
#4
客户端的DNS设置成你这个dns服务器的ip了吗
#5
设置了的。另外我用nslookup工具检测了的。由于回帖限制,刚才没有贴上来,这个是NSLOOKUP测试结果
客户端的nslookup测试
> server 192.168.192.202
Default Server: [192.168.192.202]
Address: 192.168.192.202
> www.dzs.sc
Server: [192.168.192.202]
Address: 192.168.192.202
*** [192.168.192.202] can't find www.dzs.sc: Query refused
>
服务器端的nslookup测试
[root@OA ~]# nslookup
> server 192.168.192.202
Default server: 192.168.192.202
Address: 192.168.192.202#53
> www.dzs.sc
Server: 192.168.192.202
Address: 192.168.192.202#53
Name: www.dzs.sc
Address: 192.168.192.16
>
客户端的nslookup测试
> server 192.168.192.202
Default Server: [192.168.192.202]
Address: 192.168.192.202
> www.dzs.sc
Server: [192.168.192.202]
Address: 192.168.192.202
*** [192.168.192.202] can't find www.dzs.sc: Query refused
>
服务器端的nslookup测试
[root@OA ~]# nslookup
> server 192.168.192.202
Default server: 192.168.192.202
Address: 192.168.192.202#53
> www.dzs.sc
Server: 192.168.192.202
Address: 192.168.192.202#53
Name: www.dzs.sc
Address: 192.168.192.16
>
#6
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
先备份named.conf 然后把这段去掉
直接把/etc/named.rfc1912.zones里的信息追加到named.conf的最后
然后重启named 再测试一下
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
先备份named.conf 然后把这段去掉
直接把/etc/named.rfc1912.zones里的信息追加到named.conf的最后
然后重启named 再测试一下
#7
谢谢提醒,已经解决了,我把这段里面的localhost改成any就可以了
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
改为
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
改为
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
#8
我靠!一样的问题哈!
我改成了any怎么还是不行呢?
我改成了any怎么还是不行呢?
#1
我把配置文件贴一下吧
named.caching-nameserver.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";
memstatistics-file "/var/named/data/named_mem_stats.txt";
query-source port 53;
query-source-v6 port 53;
allow-query { any; };
forwarders {192.168.1.10;};
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
named.caching-nameserver.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";
memstatistics-file "/var/named/data/named_mem_stats.txt";
query-source port 53;
query-source-v6 port 53;
allow-query { any; };
forwarders {192.168.1.10;};
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
#2
named.rfc1912.zones的配置
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 "dzs.sc" IN{
type master;
file "dzs.sc.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 "." 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 "dzs.sc" IN{
type master;
file "dzs.sc.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; };
};
#3
dzs.sc.zone的配置
$TTL 86400 @ IN SOA OA. hostmaster.
(42 ; serial (d. adams)
3H ;efresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS OA.
www IN A 192.168.192.16
jwzh IN A 192.168.192.10
jwzh IN A 192.168.192.18
oa IN A 192.168.192.16
zhcx IN A 192.168.192.87
oa.kj.dzs.sc. IN A 192.168.218.8
www.jt.dzs.sc. IN A 192.168.199.12
mail.gaj.dzs.sc. IN A 192.168.192.9
gaj.dzs.sc. IN MX 10 mail.gaj.dzs.sc.
$TTL 86400 @ IN SOA OA. hostmaster.
(42 ; serial (d. adams)
3H ;efresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS OA.
www IN A 192.168.192.16
jwzh IN A 192.168.192.10
jwzh IN A 192.168.192.18
oa IN A 192.168.192.16
zhcx IN A 192.168.192.87
oa.kj.dzs.sc. IN A 192.168.218.8
www.jt.dzs.sc. IN A 192.168.199.12
mail.gaj.dzs.sc. IN A 192.168.192.9
gaj.dzs.sc. IN MX 10 mail.gaj.dzs.sc.
#4
客户端的DNS设置成你这个dns服务器的ip了吗
#5
设置了的。另外我用nslookup工具检测了的。由于回帖限制,刚才没有贴上来,这个是NSLOOKUP测试结果
客户端的nslookup测试
> server 192.168.192.202
Default Server: [192.168.192.202]
Address: 192.168.192.202
> www.dzs.sc
Server: [192.168.192.202]
Address: 192.168.192.202
*** [192.168.192.202] can't find www.dzs.sc: Query refused
>
服务器端的nslookup测试
[root@OA ~]# nslookup
> server 192.168.192.202
Default server: 192.168.192.202
Address: 192.168.192.202#53
> www.dzs.sc
Server: 192.168.192.202
Address: 192.168.192.202#53
Name: www.dzs.sc
Address: 192.168.192.16
>
客户端的nslookup测试
> server 192.168.192.202
Default Server: [192.168.192.202]
Address: 192.168.192.202
> www.dzs.sc
Server: [192.168.192.202]
Address: 192.168.192.202
*** [192.168.192.202] can't find www.dzs.sc: Query refused
>
服务器端的nslookup测试
[root@OA ~]# nslookup
> server 192.168.192.202
Default server: 192.168.192.202
Address: 192.168.192.202#53
> www.dzs.sc
Server: 192.168.192.202
Address: 192.168.192.202#53
Name: www.dzs.sc
Address: 192.168.192.16
>
#6
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
先备份named.conf 然后把这段去掉
直接把/etc/named.rfc1912.zones里的信息追加到named.conf的最后
然后重启named 再测试一下
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
先备份named.conf 然后把这段去掉
直接把/etc/named.rfc1912.zones里的信息追加到named.conf的最后
然后重启named 再测试一下
#7
谢谢提醒,已经解决了,我把这段里面的localhost改成any就可以了
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
改为
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
改为
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
#8
我靠!一样的问题哈!
我改成了any怎么还是不行呢?
我改成了any怎么还是不行呢?