Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.