Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I successfully configured my web server (Apache, PHP etc.) and blocked the ports I don't need using iptables, which was working perfectly fine.

Today, I installed BIND and configured it, which also works. The only thing that stopped working was DNS resolving on my server itself. I'm 100% sure it's due to the iptables configuration, because when I reset the configuration, everything works fine. When I set the iptables configuration to the configuration I used before I installed BIND, however, the whole thing still does not work.

I added the following rules for DNS:

# Loopback
iptables -A INPUT -i lo -j ACCEPT   #Allow loopback access from INPUT
iptables -A OUTPUT -o lo -j ACCEPT  #Allow loopback access from OUTPUT

# DNS
iptables -A INPUT -i eth0 -p udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p udp --sport 53 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p udp --sport 53 -m state --state ESTABLISHED -j ACCEPT
share|improve this question
    
DNS uses TCP on port 53 too. – vonbrand Feb 4 '13 at 13:39
    
I tried added TCP, too, but still no dice. Does something change to the port configuration when you install BIND? – Flock Dawson Feb 4 '13 at 14:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .