DNScaching域不能从外部IPparsing

我在外部networking的CentOS盒子上使用了dnsmasq。 我的configuration文件如下所示:

port=53 bind-interfaces user=root group=dnsmasq pid-file=/var/run/dnsmasq.pid domain-needed bogus-priv no-hosts dns-forward-max=150 cache-size=1000 neg-ttl=3600 resolv-file=/etc/resolv.dnsmasq no-poll log-facility=/var/log/dnsmasq.log log-queries 

当我将我的计算机的DNS IP设置为我的VPS时,没有任何网站可以解决。 我可以在日志文件中看到

Centos默认安装并运行了iptables防火墙。 默认configuration是相当严格的。 我怀疑你的防火墙configuration中没有规定允许访问端口53.要检查

 sudo /sbin/iptables -L | grep domain 

如果你得到这样的输出

 ACCEPT udp -- anywhere anywhere udp dpt:domain ACCEPT tcp -- anywhere anywhere tcp dpt:domain 

那么端口53是开放的,你的问题在别处。

如果你得到一个空白的输出,那么你将需要添加规则来打开端口53。

 sudo /sbin/iptables -I RH-Firewall-1-INPUT -p udp -m udp --dport 53 -j ACCEPT sudo /sbin/iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 53 -j ACCEPT 

然后保存configuration

 sudo /sbin/service iptables save