CentOS下配置iptables碰到域名解析失败的问题 不能ssh到别的服务器上问题

# 允许已建立的或相关连的通行

#iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT (只有这一条就可以,为了安全起见将下面一条加上更好)

#iptables -A INPUT -m state --state INVALID -j DROP

=====================================================

以下的方法是解决不了问题的

iptables命令加上53端口(如下UDP和TCP都加满)。

iptables -A INPUT -p udp --dport 53 -j ACCEPT

iptables -A OUTPUT -p udp --sport 53 -j ACCEPT

iptables -A OUTPUT -p udp --dport 53 -j ACCEPT

iptables -A INPUT -p udp --sport 53 -j ACCEPT

iptables -A INPUT -p tcp --dport 53 -j ACCEPT

iptables -A OUTPUT -p tcp --sport 53 -j ACCEPT

iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT

iptables -A INPUT -p tcp --sport 53 -j ACCEPT