歡迎您光臨本站 註冊首頁

鬱悶,簡單配置卻出錯了

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

鬱悶,簡單配置卻出錯了

1)文件/etc/named.comf 加入:

zone "xiaodao.com" IN {
        type master;
        file "forward.xiaodao.com";
};

zone "25.172.in-addr.arpa" IN {
        type master;
        file "reverse.172.25";
};

2)文件/var/named/chroot/var/named/forward.xiaodao.com

$TTL    86400
@               IN SOA  mylinux.xiaodao.com.       root.xiaodao.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                        IN NS           mylinux.xiaodao.com.
        mylinux         IN A           172.25.40.107
        anmy           IN A            172.25.10.117
        ns              IN CNAME        mylinux

3)文件/var/named/chroot/var/named/rerverse.172.25

$TTL    86400
@       IN      SOA     mylinux.xiaodao.com.      root.xiaodao.com. (
                                      1          ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      mylinux.xiaodao.com.

117.10          IN      PTR     anmy
107.40          IN      PTR     mylinux

4)service named start
OK
5)但是nslookup anmy.xiaodao.com

Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find anmy.xiaodao.com: SERVFAIL

為什麼呀,昨天我在另外一台電腦,還成功了..真鬱悶..
《解決方案》

日誌:
Oct 15 12:06:16 mylinux named: dns_rdata_fromtext: reverse.172.25:7: near eol: unexpected end of input

Oct 15 12:06:16 mylinux named: zone 25.172.in-addr.arpa/IN: loading master file reverse.172.25: unexpected end of input
《解決方案》

Oct 15 12:06:16 mylinux named: dns_master_load: forward.xiaodao.com:10: unknown RR type 'mylinux'

Oct 15 12:06:16 mylinux named: zone xiaodao.com/IN: loading master file forward.xiaodao.com: unknown class/type
《解決方案》

# uname -a
Linux mylinux 2.6.9-34.EL #1 Fri Feb 24 16:44:51 EST 2006 i686 i686 i386 GNU/Linux

# cat /etc/hosts
127.0.0.1               mylinux localhost

# cat /etc/resolv.conf
nameserver 127.0.0.1
search localdomain

# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=mylinux
GATEWAY=172.25.0.254

# cat /etc/nsswitch.conf
hosts:      files dns
《解決方案》

唉,原來區文件前面不能有空格

參考dogdog的文章

總結下,有兩個工具
   named-checkzone命令:檢查zone文件是否正確
   named-checkconf命令:檢查named.conf文件是否正確
然後遇到了一些很鬱悶的事情,最後得知是由於dogdog.com 和com.dogdog文件中的書寫格式問題,
除了()內的不用頂格寫外,其他行都要頂格寫,不然,遇到很多不可想象的問題。
  如:no current owner name  ,
        unknown RR type 'www',
      unknown RR type 'localhos ,
   好了,習慣在於培養,養成很好的習慣就不會有很麻煩的事情了 。

[ 本帖最後由 xi2008wang 於 2007-10-15 13:51 編輯 ]
《解決方案》

最後文件如下:
1)forward.xiaodao.com

$TTL    6h
@       IN SOA  mylinux.xiaodao.com.       root.xiaodao.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

        IN NS           mylinux.xiaodao.com.
localhost       IN A            127.0.0.1
mylinux         IN A            172.25.40.107
anmy            IN A            172.25.10.117
ns              IN CNAME        mylinux.xiaodao.com.

2)reverse.172.25

$TTL    86400
@       IN      SOA     mylinux.xiaodao.com. root.xiaodao.com.  (
                        1                ; Serial
                        28800      ; Refresh
                        14400      ; Retry
                        3600000    ; Expire
                        86400 )    ; Minimum
        IN      NS      mylinux.xiaodao.com.
117.10          IN      PTR     anmy.xiaodao.com.
107.40          IN      PTR     mylinux.xiaodao.com.


成功!!

[火星人 ] 鬱悶,簡單配置卻出錯了已經有756次圍觀

http://coctec.com/docs/service/show-post-35090.html