|
下面是我配置DNS实验的实例:
[root@rhce root]# cat /etc/named.conf
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a caching only nameserver config
//
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
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 "hutek.com" IN {
type master;
file "hutek.com.zone";
allow-update { none; };
};
zone "3.12.10.in-addr.arpa" IN {
type master;
file "10.12.3.1.zone";
allow-update { none; };
};
include "/etc/rndc.key";
[root@rhce root]# cat /var/named/hutek.com.zone
$TTL 86400
@ IN SOA rhce.hutek.com. root.rhce.hutek.com. (
2004092800 ; Serial
3600 ; Refresh
300 ; Retry
3600000 ;Expire
3600 ) ; Minimum
IN NS rhce.hutek.com.
IN MX 10 mail.hutek.com.
localhost IN A 127.0.0.1
rhce IN A 10.12.3.1
www IN A 10.12.3.1
mail IN A 10.12.3.1
pop3 IN A 10.12.3.1
smtp IN A 10.12.3.1
@ IN A 10.12.3.1
[root@rhce root]# cat /var/named/10.12.3.1.zone
$TTL 86400
@ IN SOA rhce.hutek.com. root.rhce.hutek.com. (
2004092800 ; Servial
3600 ; Refresh
300 ; Retry
3600000 ; Expire
3600 ) ; Minimum
IN NS rhce.hutek.com.
IN MX 10 rhce.hutek.com.
1 IN PTR rhce.hutek.com.
1 IN PTR www.hutek.com.
[root@rhce root]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
10.12.3.1 rhce.hutek.com rhce
[root@rhce root]# cat /etc/resolv.conf
search hutek.com
nameserver 10.12.3.1
测试结果
[root@rhce root]# host rhce.hutek.com
Host rhce.hutek.com not found: 2(SERVFAIL)
[root@rhce root]# host rhce
Host rhce not found: 3(NXDOMAIN)
[root@rhce root]# host www
Host www not found: 3(NXDOMAIN)
[root@rhce root]# host mail
Host mail not found: 3(NXDOMAIN)
[root@rhce root]# nslookup
Note: nslookup is deprecated and may be removed from future
releases.
Consider using the `dig' or `host' programs instead. Run nslookup
with
the `-sil[ent]' option to prevent this message from appearing.
> host 10.12.3.75
Server: 10.12.3.1
Address: 10.12.3.1#53
** server can't find host: NXDOMAIN
> host 10.12.3.1
Server: 10.12.3.1
Address: 10.12.3.1#53
** server can't find host: NXDOMAIN
> dig 10.12.3.75
Server: 10.12.3.1
Address: 10.12.3.1#53
** server can't find dig: NXDOMAIN
> dig 10.12.3.1
Server: 10.12.3.1
Address: 10.12.3.1#53
** server can't find dig: NXDOMAIN
>
********************************************************************
***********************
[root@rhce root]# dig rhce
; <<>> DiG 9.2.1 <<>> rhce
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 44051
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;rhce. IN A
;; AUTHORITY SECTION:
. 10435 IN SOA A.ROOT-SERVERS.NET.
NSTLD.VERISI
GN-GRS.COM. 2004092801 1800 900 604800 86400
;; Query time: 1 msec
;; SERVER: 10.12.3.1#53(10.12.3.1)
;; WHEN: Wed Sep 29 11:06:05 2004
;; MSG SIZE rcvd: 97
[root@rhce root]# dig 10.12.3.1
; <<>> DiG 9.2.1 <<>> 10.12.3.1
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 56115
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;10.12.3.1. IN A
;; AUTHORITY SECTION:
. 10336 IN SOA A.ROOT-SERVERS.NET.
NSTLD.VERISI
GN-GRS.COM. 2004092801 1800 900 604800 86400
;; Query time: 0 msec
;; SERVER: 10.12.3.1#53(10.12.3.1)
;; WHEN: Wed Sep 29 11:07:16 2004
;; MSG SIZE rcvd: 102
[root@rhce root]# dig mail.hutek.com
; <<>> DiG 9.2.1 <<>> mail.hutek.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 41715
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;mail.hutek.com. IN A
;; Query time: 0 msec
;; SERVER: 10.12.3.1#53(10.12.3.1)
;; WHEN: Wed Sep 29 11:08:39 2004
;; MSG SIZE rcvd: 32
[root@rhce root]# dig pop3.hutek.com
; <<>> DiG 9.2.1 <<>> pop3.hutek.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 55480
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;pop3.hutek.com. IN A
;; Query time: 0 msec
;; SERVER: 10.12.3.1#53(10.12.3.1)
;; WHEN: Wed Sep 29 11:13:15 2004
;; MSG SIZE rcvd: 32
[root@rhce root]# dig smtp.hutek.com
; <<>> DiG 9.2.1 <<>> smtp.hutek.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 35169
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;smtp.hutek.com. IN A
;; Query time: 0 msec
;; SERVER: 10.12.3.1#53(10.12.3.1)
;; WHEN: Wed Sep 29 11:15:25 2004
;; MSG SIZE rcvd: 32
[root@rhce root]# dig www.hutek.com
; <<>> DiG 9.2.1 <<>> www.hutek.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 42325
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.hutek.com. IN A
;; Query time: 0 msec
;; SERVER: 10.12.3.1#53(10.12.3.1)
;; WHEN: Wed Sep 29 11:16:07 2004
;; MSG SIZE rcvd: 31
****************************************************
日志档
cat /var/log/messages
user=root
Sep 29 10:53:53 rhce 9月 29 10:53:53 su(pam_unix)[1148]: session
opened for use
r root by hutekmis(uid=500)
Sep 29 10:58:52 rhce named[1202]: starting BIND 9.2.1 -u named
Sep 29 10:58:52 rhce named[1202]: using 1 CPU
Sep 29 10:58:52 rhce 9月 29 10:58:52 named: named 启动 succeeded
Sep 29 10:58:52 rhce named[1202]: loading configuration from
'/etc/named.conf'
Sep 29 10:58:52 rhce named[1202]: no IPv6 interfaces found
Sep 29 10:58:52 rhce named[1202]: listening on IPv4 interface lo,
127.0.0.1#53
Sep 29 10:58:52 rhce named[1202]: listening on IPv4 interface eth0,
10.12.3.1#53
Sep 29 10:58:52 rhce named[1202]: command channel listening on
127.0.0.1#953
Sep 29 10:58:52 rhce named[1202]: zone 3.12.10.in-addr.arpa/IN: has
no NS record
s
Sep 29 10:58:52 rhce named[1202]: zone 0.0.127.in-addr.arpa/IN:
loaded serial 19
97022700
Sep 29 10:58:52 rhce named[1202]: zone hutek.com/IN: has no NS
records
Sep 29 10:58:52 rhce named[1202]: zone localhost/IN: loaded serial
42
Sep 29 10:58:52 rhce named[1202]: running
Sep 29 10:59:12 rhce named[1202]: app.c:561: unexpected error:
Sep 29 10:59:12 rhce named[1202]: isc_app_shutdown() pthread_kill:
No such proce
ss
帮我分析一下问题在哪,谢谢啦 |
|