当前位置: 技术问答>linux和unix
在一台DNS服务器上,如果使用二个以上的域名,就不能成功?
来源: 互联网 发布时间:2016-10-27
本文导语: nslookup www.holly.com or nslookup 192.168.0.254 都是成功的. [root@vmserver etc]# nslookup 192.168.0.4 Server: 127.0.0.1 Address: 127.0.0.1#53 4.0.168.192.in-addr.arpa name = www.hcet.com.0.168.192.in-addr.arpa....
nslookup www.holly.com or nslookup 192.168.0.254 都是成功的.
[root@vmserver etc]# nslookup 192.168.0.4
Server: 127.0.0.1
Address: 127.0.0.1#53
4.0.168.192.in-addr.arpa name = www.hcet.com.0.168.192.in-addr.arpa.
也是成功的,
但是这下句就出错了.
[root@vmserver named]# nslookup www.hcet.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: www.hcet.com
Address: 64.95.64.197
配制文件如下:
[root@vmserver named]# vi holly.com.zone
$TTL 86400
@ IN SOA holly.com root.holly.com (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
holly.com. IN NS www.holly.com.
hcet.com. IN NS www.hcet.com.
www.holly.com. IN A 192.168.0.254
www.hcet.com. IN A 192.168.0.4
[root@vmserver named]# cat holly.com.local
@ 86400 IN SOA holly.com. root.holly.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS www.holly.com
IN NS www.hcet.com
254 IN PTR www.holly.com.
4 IN PTR www.hcet.com
[root@vmserver etc]# cat named.rfc1912.zones
zone "holly.com" IN {
type master;
file "holly.com.zone";
allow-query { any; };
allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "holly.com.local";
allow-query { any; };
allow-update { none; };
};
[root@vmserver etc]# cat named.caching.-nameserver.conf.original
options {
// listen-on port 53 { 127.0.0.1; };
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";
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
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;
include "/etc/named.rfc1912.zones";
};
[root@vmserver etc]# nslookup 192.168.0.4
Server: 127.0.0.1
Address: 127.0.0.1#53
4.0.168.192.in-addr.arpa name = www.hcet.com.0.168.192.in-addr.arpa.
也是成功的,
但是这下句就出错了.
[root@vmserver named]# nslookup www.hcet.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: www.hcet.com
Address: 64.95.64.197
配制文件如下:
[root@vmserver named]# vi holly.com.zone
$TTL 86400
@ IN SOA holly.com root.holly.com (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
holly.com. IN NS www.holly.com.
hcet.com. IN NS www.hcet.com.
www.holly.com. IN A 192.168.0.254
www.hcet.com. IN A 192.168.0.4
[root@vmserver named]# cat holly.com.local
@ 86400 IN SOA holly.com. root.holly.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS www.holly.com
IN NS www.hcet.com
254 IN PTR www.holly.com.
4 IN PTR www.hcet.com
[root@vmserver etc]# cat named.rfc1912.zones
zone "holly.com" IN {
type master;
file "holly.com.zone";
allow-query { any; };
allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "holly.com.local";
allow-query { any; };
allow-update { none; };
};
[root@vmserver etc]# cat named.caching.-nameserver.conf.original
options {
// listen-on port 53 { 127.0.0.1; };
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";
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
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;
include "/etc/named.rfc1912.zones";
};
|
www.holly.com. IN A 192.168.0.254
www.hcet.com. IN A 192.168.0.4
---------------
这2个域名都不一样 zone文件不要写在一起!
而且你看看named.conf里的设置zone "holly.com" IN { 这里设置的是holly.com
hcet.com的域名 另外新建一个zone
然后在named.conf里也新直接 zone "hcet.com" IN {
不要把正引和反引混淆着看。
www.hcet.com. IN A 192.168.0.4
---------------
这2个域名都不一样 zone文件不要写在一起!
而且你看看named.conf里的设置zone "holly.com" IN { 这里设置的是holly.com
hcet.com的域名 另外新建一个zone
然后在named.conf里也新直接 zone "hcet.com" IN {
不要把正引和反引混淆着看。