Port 53: DNS

Port 53 (TCP/UDP) is used by DNS. Domain Name System. Queries use UDP; zone transfers and large responses use TCP.

53Port
TCP/UDPProtocol
domainIANA service name
Network infrastructureCategory

Port range

53 is a well-known (system) port (range 0–1023). On Linux and macOS, binding to it traditionally needs root or the CAP_NET_BIND_SERVICE capability.

Security

Only open port 53 to the hosts that need it. Prefer the encrypted variant of the protocol where one exists.

Open port 53 in a firewall

ufw         sudo ufw allow 53/tcp
            sudo ufw allow 53/udp
iptables    sudo iptables -A INPUT -p tcp --dport 53 -j ACCEPT
            sudo iptables -A INPUT -p udp --dport 53 -j ACCEPT
firewalld   sudo firewall-cmd --permanent --add-port=53/tcp
            sudo firewall-cmd --permanent --add-port=53/udp
Windows     New-NetFirewallRule -DisplayName "DNS 53" -Direction Inbound -Protocol TCP -LocalPort 53 -Action Allow

Check if port 53 is open

nc -vz example.com 53
Test-NetConnection example.com -Port 53   # PowerShell
sudo ss -tulpn | grep ':53 '   # what is listening locally (Linux)

Other network infrastructure ports

Frequently asked questions

What is port 53 used for?
DNS. Domain Name System. Queries use UDP; zone transfers and large responses use TCP.
Is port 53 TCP or UDP?
Both are assigned. DNS queries normally use UDP and fall back to TCP for large answers.