linux配置dns几个问题的解决方法
linux下搭dns服务,真是头痛。拖了挺久。今天在高人的帮助下解决了。哈哈哈。
安装就不用说了。
1.named服务启动失败。
[root@vi named]# service named restart
Stopping named: [ OK ]
Starting named: [ FAILED ]
查看日志 /var/log/messages 如下
Jul 17 00:29:07 vi named[8287]: none:0: open: /etc/named.conf: permission denied
查看named.conf权限
[root@vi named]# ls -l /etc/named.conf
-rw-r–r– 1 root root 1264 Jul 17 13:36 /etc/named.conf
[root@vi named]# chmod 755 /etc/named.conf
[root@vi named]# ls -l /etc/named.conf
-rwxr-xr-x 1 root root 1368 Jul 17 14:04 /etc/named.conf
问题解决。
2. 本机能解析,但客户机不能解析.
把默认的named.conf文件中 以下部份注释掉
//view localhost_resolver {
// match-clients { localhost; };
// match-destinations { localhost; };
// recursion yes;
// include “/etc/named.rfc1912.zones”;
//};
3. 有用的命令 named -g
[root@vi named]# named -g
17-Jul-2009 14:09:10.579 starting BIND 9.3.4-P1 -g
17-Jul-2009 14:09:10.579 found 1 CPU, using 1 worker thread
17-Jul-2009 14:09:10.581 loading configuration from ‘/etc/named.conf’
17-Jul-2009 14:09:10.582 listening on IPv6 interface lo, ::1#53
17-Jul-2009 14:09:10.582 binding TCP socket: address in use
17-Jul-2009 14:09:10.582 listening on IPv4 interface lo, 127.0.0.1#53
17-Jul-2009 14:09:10.583 binding TCP socket: address in use
17-Jul-2009 14:09:10.583 listening on IPv4 interface eth0, 210.34.1.1#53
17-Jul-2009 14:09:10.583 binding TCP socket: address in use
17-Jul-2009 14:09:10.584 couldn’t add command channel 127.0.0.1#953: address in use
17-Jul-2009 14:09:10.585 couldn’t add command channel ::1#953: address in use
17-Jul-2009 14:09:10.585 ignoring config file logging statement due to -g option
17-Jul-2009 14:09:10.585 couldn’t open pid file ‘/var/run/named/named.pid’: Permission denied
17-Jul-2009 14:09:10.585 exiting (due to early fatal error)
哇卡!一进来看见这个 不错不错!!
哈哈哈。@小杰