|
DNS server: sea.cc (hostname) IP:192.168.1.20
DNS client: fish <--> 192.168.1.21 ; frog <--> 192.168.1.22
下面是几个配置文件:
1.cat named.conf.options
options {
directory "/var/cache/bind";
forwarders {
192.168.1.20;
202.101.224.68;
202.101.224.69;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
2. cat named.conf.local
// prime the server sea
zone "sea.cc" {
type master;
file "/etc/bind/db.sea";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.192";
};
3. cat db.sea
$TTL 604800
@ IN SOA sea.cc. root.sea.cc. (
10010 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS sea.cc.
@ IN A 192.168.1.20
ftp IN A 192.168.1.20
fish.cc IN A 192.168.1.21
frog.cc IN A 192.168.1.22
4.cat db.192
$TTL 604800
@ IN SOA sea.cc. root.sea.cc. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS sea.cc.
20 IN PTR sea.cc.
21 IN PTR fish.cc.
22 IN PTR frog.cc.
5. cat /etc/resolv.conf
nameserver 192.168.1.20
nameserver 202.101.224.69
看看是哪个文件写错了,就想用 .cc作为域名,通过 sea.cc、fish.cc 、frog.cc 能访问到各自对应的机器
现在sea.cc 、ftp.sea.cc都能访问,就是访问不了 fish.cc 、frog.cc;通过nslookup不能查到fish.cc 、frog.cc对应的IP地址,但是利用它们各自的地址却能查到对应的名字。 |
|