Toolman 100% local

Port 53 — DNS

TCP/UDP well-known

What runs on port 53

Domain name resolution. UDP for normal queries, TCP for responses over 512 bytes and for zone transfers.

DNS uses UDP for ordinary queries and TCP for anything over 512 bytes, including zone transfers and most DNSSEC responses. Firewalls that allow only UDP 53 produce a characteristic failure: most lookups work, and specific ones — usually the DNSSEC-signed or unusually large records — time out. An open recursive resolver is a serious liability because a small query can be made to produce a large answer, which makes it an amplifier for denial-of-service attacks against someone else.

Security considerations

An open recursive resolver will be abused for DNS amplification attacks. Restrict recursion to your own networks.

Checking whether something is listening

# Linux / macOS — what is bound to the port
sudo lsof -i :53
sudo ss -lntp | grep :53

# Windows
netstat -ano | findstr :53
Get-NetTCPConnection -LocalPort 53

# is it reachable from outside?
nc -zv example.com 53
curl -v telnet://example.com:53

Freeing the port

# find the process, then stop it
sudo lsof -ti :53 | xargs kill        # Linux / macOS
netstat -ano | findstr :53            # note the PID, then:
taskkill /PID <pid> /F                    # Windows

Should this port be open to the internet?

Usually not. Expose it only if a specific external client needs it, and restrict by source address where you can.

Opening or blocking port 53

This one is meant to be reachable, so the blanket rule is the normal answer and the narrow form under it is for the case where the service is internal-only:

# ufw — Debian, Ubuntu
sudo ufw allow 53/tcp/udp
sudo ufw allow from 10.0.0.0/8 to any port 53 proto tcp/udp   # if it only serves internally

# firewalld — RHEL, Fedora, CentOS
sudo firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address=10.0.0.0/8 port port=53 protocol=tcp/udp accept'
sudo firewall-cmd --reload

# iptables, if you are still there
sudo iptables -A INPUT -p tcp/udp --dport 53 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp/udp --dport 53 -j DROP

# Windows
New-NetFirewallRule -DisplayName "DNS 53" -Direction Inbound -Protocol TCP/UDP -LocalPort 53 -RemoteAddress 10.0.0.0/8 -Action Allow

10.0.0.0/8 stands in for a private range — substitute your own. Note that a firewall rule does not undo a service bound to 0.0.0.0; it only stops packets reaching it, and a misconfigured or disabled firewall then exposes it immediately.

Quick reference

Port53
ProtocolTCP/UDP
ServiceDNS
RangeWell-known (0–1023) — binding requires root on Unix

Frequently asked questions

What is port 53 used for?

Domain name resolution. UDP for normal queries, TCP for responses over 512 bytes and for zone transfers.

Is it safe to open port 53?

An open recursive resolver will be abused for DNS amplification attacks. Restrict recursion to your own networks.

How do I check if port 53 is open?

Locally, sudo lsof -i :53 on macOS or Linux, or netstat -ano | findstr :53 on Windows. From outside, nc -zv host 53 tells you whether anything answers.

Why do I get "address already in use" on port 53?

Another process is bound to it — often a previous run of your own program that did not exit cleanly. Find it with lsof -ti :53 and stop it, or configure your application to use a different port.

Can I change the port this service uses?

Almost always yes, in the service's configuration. Moving off a default port reduces automated scan noise, but it is obfuscation rather than security — a real attacker scans all 65,535.

Other common ports

All port numbers