LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 798|回复: 3

关于bind-我在论坛也翻了一些帖子 ,可是都没有找到解决方法,因为我看不同的帖子配置文

[复制链接]
发表于 2005-6-29 19:31:42 | 显示全部楼层 |阅读模式
各位老大,请教一个bind的问题,反向解析正常的,但是自己设置的域名pk2ak47.com为何无法解析?

配置文件一:
guest@0[Debian]$ cat /etc/bind/named.conf | less

// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//

options {
        directory "/var/cache/bind";

        // 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 and later use an unprivileged
        // port by default.

        // query-source address * port 53;

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

        // forwarders {
        //      0.0.0.0;
        // };

        auth-nxdomain no;    # conform to RFC1035

};

// prime the server with knowledge of the root servers
zone "." {
        type hint;
        file "/var/cache/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912


zone "pk2ak47.com" {
        type master;
        file "/var/cache/bind/db.gst";
};

zone "localhost" {
        type master;
        file "/var/cache/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/var/cache/bind/db.127";
};

zone "0.in-addr.arpa" {
        type master;
        file "/var/cache/bind/db.0";
};

zone "255.in-addr.arpa" {
        type master;
        file "/var/cache/bind/db.255";
};

zone "66.0.10.in-addr.arpa" {
        type master;
        file "/var/cache/bind/db.10.0.66";
};

// add entries for other zones below here

配置文件二:
guest@0[Debian]$ cat /var/cache/bind/db.gst | less
;
; BIND data file for pk2ak47.com
;
$TTL    604800
@       IN   SOA  debian.pk2ak47.com. root.debian-sk.pk2ak47.com. (
                       20050628         ; Serial
                           3600         ; Refresh
                          72000         ; Retry
                          36000         ; Expire
                       604800 )         ; Negative Cache TTL
                             NS         pk2ak47.com.
;
pk2ak47.com.  IN      NS      debian.pk2ak47.com.
pk2ak47.com.  IN      A       172.25.3.237
;
ns1.pk2ak47.com.        IN      A       10.0.66.73
;
www IN CANME debian.pk2ak47.com.
ftp IN CNAME debian.pk2ak47.com.
mail IN CNAME debian.pk2ak47.com.

下面是结果:
guest@0[Debian]$ dig -x 127.0.0.1

; <<>> DiG 9.2.1 <<>> -x 127.0.0.1
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59128
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;1.0.0.127.in-addr.arpa.                IN      PTR

;; ANSWER SECTION:
1.0.0.127.in-addr.arpa. 604800  IN      PTR     debian.pk2ak47.com.

;; AUTHORITY SECTION:
127.in-addr.arpa.       604800  IN      NS      debian.pk2ak47.com.

;; Query time: 318 msec
;; SERVER: 172.25.3.237#53(172.25.3.237)
;; WHEN: Wed Jun 29 19:04:51 2005
;; MSG SIZE  rcvd: 86

但是pk2ak47.com解析不出来,
guest@0[Debian]$ dig pk2ak47.com

; <<>> DiG 9.2.1 <<>> pk2ak47.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 49741
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;pk2ak47.com.                   IN      A

;; Query time: 4 msec
;; SERVER: 172.25.3.237#53(172.25.3.237)
;; WHEN: Wed Jun 29 19:04:42 2005
;; MSG SIZE  rcvd: 29
请哪位老大给予分析?.
发表于 2005-6-29 23:51:01 | 显示全部楼层
配置中没有发现对debian.pk2ak47.com的项目(IN A)。再有就是查看一下日志,很多问题都有反映。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-6-30 14:45:17 | 显示全部楼层
我也见到一些帖子这样说,
cat /var/log/message对吧? 没看到日志艾,准确地说是有两条很奇怪的日志,晚上发上来,现在上班不方便,到时候请帮助分析~
谢谢~!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-6-30 18:17:41 | 显示全部楼层
ok,解决了!
;
; BIND data file for pk2ak47.com
;
$TTL    604800
@       IN   SOA  debian.pk2ak47.com. root.debian..pk2ak47.com. (
                       20050628         ; Serial
                           3600         ; Refresh
                          72000         ; Retry
                          36000         ; Expire
                       604800 )         ; Negative Cache TTL
                             NS         pk2ak47.com.
;
pk2ak47.com.  IN      NS      pk2ak47.com.
pk2ak47.com.  IN      A       172.25.3.237
;
debian.pk2ak47.com.     IN      A       10.0.66.73
;
www IN CNAME debian.pk2ak47.com.
ftp IN CNAME debian.pk2ak47.com.
mail IN CNAME debian.pk2ak47.com.
还有我上面的配置文件CNAME写反了,写成CANME,应该是
cat /var/log/syslog | less ,看得很清楚的,谢谢,如下:
Jun 30 17:53:55 localhost named[2160]: loading configuration from '/etc/bind/named.conf'
Jun 30 17:53:55 localhost named[2160]: dns_master_load: db.gst:18: unknown RR type 'CANME'
Jun 30 17:53:55 localhost named[2160]: zone pk2ak47.com/IN: loading master file db.gst: unknown class/type

要注意几点:括号和空格不要少,拼写注意,多上论坛提问~
感谢memory!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表