- 论坛徽章:
- 8
|
[root@mailtest1 etc]# rpm -qa|grep bind
bind-chroot-9.3.3-7.el5
bind-utils-9.3.3-7.el5
bind-9.3.3-7.el5
bind-libs-9.3.3-7.el5
ypbind-1.19-7.el5
[root@mailtest1 etc]# uname -a
Linux mailtest1 2.6.18-8.el5 #1 SMP Thu Mar 15 19:57:35 EDT 2007 i686 i686 i386 GNU/Linux
[root@mailtest1 etc]#
OS:CentOS5
[root@mailtest1 etc]# nslookup
> www.test.hk
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: www.test.hk
Address: 10.10.119.200
> server 10.10.119.200
Default server: 10.10.119.200
Address: 10.10.119.200#53
> www.test.hk
;; connection timed out; no servers could be reached
[root@mailtest1 etc]# ping www.test.hk
PING www.test.hk (10.10.119.200) 56(84) bytes of data.
64 bytes from www.test.hk (10.10.119.200): icmp_seq=1 ttl=64 time=0.391 ms
64 bytes from www.test.hk (10.10.119.200): icmp_seq=2 ttl=64 time=0.082 ms
64 bytes from www.test.hk (10.10.119.200): icmp_seq=3 ttl=64 time=0.080 ms
--- www.test.hk ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 0.080/0.184/0.391/0.146 ms
named.conf
options {
# listen-on port 53 { 10.10.119.200; };
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";
query-source port 53;
query-source-v6 port 53;
pid-file "/var/run/named/named.pid";
allow-query { localhost; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
key "rndckey" {
algorithm hmac-md5;
secret "vt/j+jC7MxIoB+9emnuKqw==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndckey"; };
};
#controls {
# inet 10.10.119.200 port 953
# allow { 10.10.119.200; } keys { "rndckey"; };
#};
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.hk" IN {
type master;
file "named.test.hk";
};
zone "119.10.10.in-addr.arpa" IN {
type master;
file "named.10.10.119";
allow-update { none; };
};
[root@mailtest1 etc]# more /var/named/named.test.hk
$TTL 86400
@ IN SOA center.net. ruochen0926.hotmail.com (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS www.test.hk.
@ IN MX 0 mail.test.hk.
localhost. IN A 127.0.0.1
www IN A 10.10.119.200
mail IN A 10.10.119.200
[root@mailtest1 etc]# more /var/named/named.10.10.119
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS localhost.
localhost. IN PTR localhost.
200 IN PTR www.test.hk.
就是怎么将DNS从127.0.0.1改成10.10.119.200
好让别人也能用这个DNS
在本机测试http://www.test.hk已经好了(从本文的开头ping的输出也可以看出来)
[ 本帖最后由 ruochen 于 2007-9-18 19:41 编辑 ] |
|