Chinaunix

标题: 大家帮我分析一下我错在哪里。 [打印本页]

作者: zlhgo    时间: 2007-02-02 10:51
标题: 大家帮我分析一下我错在哪里。
这全是网站照着写的。但是不知道为什么不能解析
[root@linux named]# 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.
> www.zlhgo.com
Server:         192.168.0.106
Address:        192.168.0.106#53

** server can't find www.zlhgo.com: SERVFAIL


[root@linux named]# cat zlhgo.com.zone
$TTL 86400
@         IN SOA www.zlhgo.com. root.zlhgo.com. (  
                      42         ; Serial(d.adams)
                      3H         ; refresh
                      15M        ; retry  
                      1W         ; expire
                      1D )       ; minimum
          IN NS www.zlhgo.com.
@         IN MX 10 mail.zlhgo.com.
localhost IN A 127.0.0.1
www       IN A 192.168.0.106
mail      IN A 192.168.0.106
pop3      IN A 192.168.0.106
smtp      IN A 192.168.0.106


[root@linux named]# 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 "zlhgo.com" IN {
        type master;
        file "zlhgo.com.zone";
};

include "/etc/rndc.key";
作者: jianasonic    时间: 2007-02-02 11:07
$TTL 86400
@         IN SOA  ns.zlhgo.com. root.zlhgo.com. (  
                      42         ; Serial(d.adams)
                      3H         ; refresh
                      15M        ; retry  
                      1W         ; expire
                      1D )       ; minimum
          IN   NS zlhgo.com.
www    IN A 192.168.0.106
mail      IN A 192.168.0.106
pop3      IN A 192.168.0.106
smtp      IN A 192.168.0.106
作者: zlhgo    时间: 2007-02-02 11:14
这么大哥用给小弟详细说一下吗?
谢谢。在线等你

你的意思是不是把
@         IN MX 10 mail.zlhgo.com.
前面那一个@去掉
我第一次去没有加这个@也不行。后来我看有的人加了。我加上去还是不行的
作者: jianasonic    时间: 2007-02-02 11:23
你把我上面的文字COPY到你文件力。。重启服务。。试下。。。DNS这个东西。。需要先看看配置文档比较好,起码自己知道每行的意思。。自己在做什么。
作者: zlhgo    时间: 2007-02-02 11:32
大哥。测试的时候。还是返回一样的信息。
大哥。帮我再想想别的方法,谢谢
我也不知道为是什么问题。我的防火墙都关了的
作者: jianasonic    时间: 2007-02-02 12:46
把日志贴出来。。。。。
作者: 小桂桂    时间: 2007-02-02 21:19
[root@linux named]# vi zlhgo.com.zone
$TTL 86400
@         IN SOA mail.zlhgo.com. root.zlhgo.com. (  
                      42         ; Serial(d.adams)
                      3H         ; refresh
                      15M        ; retry  
                      1W         ; expire
                      1D )       ; minimum
@          IN NS mail.zlhgo.com.
mail       IN A 192.168.0.106
www       IN CNAME mail
pop3      IN CNAME mail
smtp      IN CNAME mail
mail      IN MX 10   mail.zlhgo.com.

[root@linux named]# vi /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 "zlhgo.com" IN {
        type master;
        file "zlhgo.com.zone";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "named.local";
        allow-update { none; };
};



include "/etc/rndc.key";

试试看,如有错误,请指教。
作者: woaixiaoji1    时间: 2007-02-04 13:11
标题: 要学会看系统日志
先重新启动dns   /etc/rc.d/init.d/named restart
然后查看系统日志
tail -n 12 /var/log/messages
找出问题所在,再具体问题具体解决
作者: zlhgo    时间: 2007-02-05 15:06
[root@linux root]# tail -n 12 /var/log/messages
Feb  5 02:15:47 linux named[1728]: exiting
Feb  5 15:15:47 linux named:  succeeded
Feb  5 02:15:49 linux named[1982]: starting BIND 9.2.2-P3 -u named -t /var/named/chroot
Feb  5 02:15:49 linux named[1982]: using 1 CPU
Feb  5 02:15:49 linux named[1982]: loading configuration from '/etc/named.conf'
Feb  5 15:15:49 linux named: named 启动 succeeded
Feb  5 02:15:49 linux named[1982]: no IPv6 interfaces found
Feb  5 02:15:49 linux named[1982]: listening on IPv4 interface lo, 127.0.0.1#53
Feb  5 02:15:49 linux named[1982]: listening on IPv4 interface eth0, 192.168.0.106#53
Feb  5 02:15:49 linux named[1982]: command channel listening on 127.0.0.1#953
Feb  5 02:15:49 linux named[1982]: zone zlhgo.com/IN: loading master file zlhgo.com.zone: file not found
Feb  5 02:15:49 linux named[1982]: running

不好意思,各位大哥。因为我在公司上网。星期六星期天休息。希望名位继续帮帮忙。我要先把DNS学会。然后再学做邮件服务器。谢谢各位
作者: zlhgo    时间: 2007-02-05 15:10
小桂桂 哥哥
我试了还是一样的不行
我的系统是FC1家里的那台也是这个系统。测试的时候还是一样的错

我用nslookup
测试localhost也不行。错误的意思好像是连接超时
谢谢各位哥哥,姐姐们
作者: jianasonic    时间: 2007-02-05 23:30
Feb  5 02:15:49 linux named[1982]: zone zlhgo.com/IN: loading master file zlhgo.com.zone: file not found
????
作者: zlhgo    时间: 2007-02-06 17:45
可是我这个文件是有的啊.你也看到我发的贴子都贴出来了的.
各位大哥在帮我想想,我做了好几个不同的域名解析还是一样的
作者: 小桂桂    时间: 2007-02-08 19:25
zlhgo我也是刚学linux一个月,我没玩过FC1,我给出来的是红帽linux 8的DNS配置,我能解释的也有限.不过我会尽我所会的帮助你.请你关注论坛,我会给向咱们这样的初学者出一些我做的例子,也就是小桂教程 哈哈 我都有些不好意思了.到时候希望大家多多指点和指正.希望能给初学者们带进linux里不用多绕弯路.
作者: zlhgo    时间: 2007-02-09 15:10
还是谢谢各位帮忙的大哥
DNS已经掌握了...

我也走了不少弯路
现在我说一下我是怎么解决的
我的系统是FC1
我以前把zlhgo.com.zone这个数据文件放在/var/named这个目录下面
日志提示找不到文件.原来这个系统是放到/var/named/chroot这个目录下面才可
zone "zlhgo.com" IN {
         type master;
         file    "zlhgo.com.zone";
};


像这个东西用FC1系统的话.好像放在/etc/named.conf这个文件里面好像是不行的.
要放在/var/named/chroot/etc/named.conf
正向和反像的都要放在这里面.不管放好多
还有一点我走的弯路也说一下.
日志提示英文我忘了.我就说一下中文吧.意思好像是输入被意外的结束
原来是;refresh这几句的;号和后面的英文没有空格
42         ; Serial(d.adams)
                      3H         ; refresh
                      15M        ; retry  
                      1W         ; expire
                      1D )       ; minimum

也谢谢大学帮忙.下一步要学习邮件服务器了.也希望大家能继续帮我




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2