我的Centos 6.4不接受DNS请求

我在新安装的centos 6.4系统上遇到了dns服务器的问题。 我去通过教程,尝试iptables的configuration,但无法find解决scheme。 我已经安装了绑定,为我的域名创build了一个configuration文件,重新启动了命名服务,但是当我在浏览器上打我的域名时,我无法parsing域名。 这是我的iptablesconfiguration:

# Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -I INPUT -p udp -m state --state NEW --dport 53 -j ACCEPT -A INPUT -p tcp -m state --state NEW --dport 53 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -p udp -m udp --dport 53 -j ACCEPT -A OUTPUT -p udp -m udp --sport 53 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT 

命令“iptables -vnL | grep 53”的输出:

 529 39514 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:53 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:53 0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:53 152 10920 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp spt:53 

netstat -ntupl命令输出:

 Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 3429/php fpm tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 3414/master tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 3308/mysqld tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 3497/perl tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 3936/named tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3064/sshd tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 3936/named tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 3414/master tcp 0 0 127.0.0.1:2812 0.0.0.0:* LISTEN 3462/monit tcp 0 0 :::80 :::* LISTEN 3605/httpd tcp 0 0 ::1:53 :::* LISTEN 3936/named tcp 0 0 :::22 :::* LISTEN 3064/sshd tcp 0 0 ::1:953 :::* LISTEN 3936/named tcp 0 0 :::443 :::* LISTEN 3605/httpd udp 0 0 127.0.0.1:53 0.0.0.0:* 3936/named udp 0 0 0.0.0.0:783 0.0.0.0:* 2934/portreserve udp 0 0 0.0.0.0:10000 0.0.0.0:* 3497/perl udp 0 0 ::1:53 :::* 3936/named 

我不知道如何解决这个问题。 有人有任何想法或任何暗示吗? 提前致谢。

伊恩的回答把我推向了正确的方向。

在我的例子中,使用绑定和named.conf缺乏以下更改:

  • 监听外部接口(可以明确定义,而不是'any'通配符)
  • 允许来自本地networking的查询; 例如allow-query { 192.168.1.0/24; }; allow-query { 192.168.1.0/24; };

你没有听你的外部地址。 您目前只在收听

TCP和UDP的127.0.0.1:953::1:953以及TCP上的127.0.0.1:953::1:953

这些是IPv4和IPv6环回地址。 你需要正确configuration你的listen-on指令,例如

 listen-on {any;};