Centos iptables open port 53

Your semantics are reversed.

The rules you posted permit outgoing DNS connections to a remote DNS server, not incoming connections to a local DNS server.

To permit connections to your local DNS server, reverse the INPUT and OUTPUT rules:

-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -p udp -m udp --sport 53 -j ACCEPT

(And please take a few minutes at some point to revise your firewall to be stateful.)


Use -I instead of -A .

As you have a DNS server listening then it will be listening on port 53 so the input rule should be

-I INPUT -p udp -m udp --dport 53 -j ACCEPT