Network security

What Is Port 53? The DNS Port Explained (UDP, TCP and Risks)

Port 53 is the port DNS uses to turn domain names into IP addresses. Here is how it works on UDP and TCP, when it is safe to leave open, and the attacks that abuse it.

Cysoro Security TeamPublished · 7 min read
NETWORK SECURITY What Is Port 53? The DNS port, on UDP and TCP — explained 53 DNS · domain UDP + TCP example.com → 93.184.216.34 UDP · fast TCP · reliable
Quick answer

Port 53 is the port assigned to the Domain Name System (DNS). When you type a domain name into a browser, your device sends a DNS query to a DNS server on port 53, usually over UDP, and the server answers with the IP address for that name. TCP port 53 is used for larger answers and zone transfers. It is a well-known system port in IANA's registry, listed under the service name "domain".

Key takeaways

  • Port 53 is the DNS port: it carries the queries that turn domain names into IP addresses, mostly over UDP.
  • TCP port 53 matters too — it handles large answers, DNSSEC responses and zone transfers, so blocking it breaks real lookups.
  • An open DNS resolver on port 53 can be abused for DNS amplification attacks, so recursion must be limited to your own users.

Every website visit starts with a question your device asks on port 53: "What is the IP address for this name?" Without that one port, the internet would still work — but you would have to type numbers instead of names, and nothing would load.

What is port 53?

Port 53 is the port assigned to the Domain Name System (DNS), the service that translates human-readable domain names like example.com into the IP addresses computers use to reach each other. IANA, the body that manages port assignments, lists port 53 under the service name "domain" for both TCP and UDP.

Ports are numbered channels that direct traffic to the right service on a machine. Port 53 is a well-known system port, in the 0–1023 range reserved for core services. When any program needs to reach a hostname, it sends a DNS query to a DNS server on port 53, and the answer comes back on the same port.

You use port 53 constantly without noticing. Browsing, email, app updates, video calls and smart-home devices all resolve names through it, often dozens of times per page load. If DNS stops working, almost everything stops with it — even though your internet connection itself is fine.

How does DNS work on port 53?

A DNS lookup on port 53 follows four steps, and the whole exchange usually takes a few milliseconds. Your device asks a resolver, the resolver asks the servers that own the answer, and the answer comes back down the chain.

A DNS lookup on port 53, step by step1Your device asksbrowser needs the IPfor example.com2Resolver queriesroot, then TLD,then authoritative3Authoritativeserver answerswith the A record4Browser connectsto the IP address,usually on port 443Every step of the lookup travels over port 53 — until the browser switches to the web port.
How a domain name becomes an IP address over port 53. Illustration by Cysoro.

The DNS system itself is defined in RFC 1035, published in 1987. It has been extended many times since — for security (DNSSEC), larger messages (EDNS0) and encryption — but the port has never changed. That stability is why port 53 is one of the most recognized numbers in networking.

You can watch this happen yourself. Our free DNS lookup tool shows the records a domain publishes, which is exactly the information a port 53 query returns.

Is port 53 UDP or TCP?

Port 53 is both. IANA registers it for UDP and TCP, and DNS uses each protocol for different jobs. Most queries use UDP because it is fast: one small packet out, one small packet back, no connection setup. TCP takes over when the answer is too large for a single UDP packet.

The classic size limit was 512 bytes for a UDP DNS message. When a response would exceed that, the server sets a truncation flag and the client retries over TCP. DNSSEC-signed answers and large record sets hit that limit often, which is why TCP support is now a full requirement: RFC 7766 made it mandatory for DNS software, not optional.

UDP port 53TCP port 53
Used forMost routine queries and answersLarge answers, DNSSEC, zone transfers
SpeedFaster — no handshakeSlower — connection setup first
ReliabilityNo delivery guaranteeOrdered, retransmits lost data
Typical messageOne small lookup, one small answerFull zone copy between servers
RiskSource address can be spoofedHarder to spoof, still needs hardening
Block it?No — DNS stops workingNo — large answers break

Microsoft's own documentation describes the same split: DNS clients send queries from a high-numbered source port to destination port 53, and responses come back from source port 53. When a message exceeds the UDP size limit, the client reissues the request over TCP port 53. A firewall that allows UDP 53 but blocks TCP 53 will break real lookups in ways that are hard to diagnose.

Port 53 vs port 853, 443 and 5353

Port 53 is the original DNS port, but it is no longer the only one. Encrypted DNS and local discovery use different ports, and confusing them is a common source of firewall mistakes.

PortProtocolWhat it does
53DNS (plain)Standard DNS queries, UDP and TCP, unencrypted
853DNS over TLS (DoT)Encrypted DNS between device and resolver
443DNS over HTTPS (DoH)DNS queries sent inside HTTPS traffic
5353Multicast DNS (mDNS)Local device discovery, no central server
80HTTPUnencrypted web traffic — not DNS
443HTTPSEncrypted web traffic — also carries DoH

The key point is that plain DNS on port 53 is unencrypted: anyone on the path can read the names you look up and, in principle, tamper with the answers. DNS over TLS on port 853 and DNS over HTTPS on port 443 fix that by encrypting the query. They do not replace port 53 — they sit alongside it, and most devices still fall back to port 53.

Is port 53 safe? The security risks

Port 53 itself is not dangerous — it is just the channel DNS uses. The risks come from how DNS servers on that port are configured, and from the fact that plain DNS traffic is unencrypted. Four attacks abuse port 53 regularly.

DNS amplification attacks

DNS amplification turns other people's DNS servers into a weapon. An attacker sends small DNS queries with the victim's IP address forged as the source. The servers send their much larger replies to the victim, flooding its connection. The attack works because UDP does not verify the sender, and because a small query can trigger a far larger answer.

The fix is on the server side: do not run an open recursive resolver. Recursion should be limited to your own users or networks, and authoritative servers should use response rate limiting. If your server answers DNS queries for the whole internet, it is part of the problem.

Cache poisoning and spoofing

Cache poisoning tricks a resolver into storing a forged answer, so everyone using that resolver gets sent to the attacker's server. Modern resolvers use randomized source ports and transaction IDs to make guessing the right forged reply hard, and DNSSEC adds cryptographic signatures so forged answers can be detected.

DNS tunneling

DNS tunneling hides data inside DNS queries, often to smuggle information out of a network or to control malware. Because port 53 is almost always allowed out through firewalls, it is an attractive channel. The defense is to force devices to use approved resolvers, log DNS queries, and investigate endpoints that make unusual volumes of long, random-looking queries.

DNS hijacking and tampering

Attackers who compromise the accounts that control a domain's DNS records can redirect its web and email traffic to servers they control — and even obtain valid certificates for the domain. CISA's guidance on mitigating DNS infrastructure tampering stresses reviewing DNS records, changing DNS account passwords, and enforcing multi-factor authentication on every account that can change DNS records.

Should port 53 be open on my firewall?

For most networks the rule is simple: allow port 53 outbound to your chosen resolvers, and allow it inbound only on servers that are meant to answer DNS queries. Everything else should stay closed.

  • Home and office networks: allow outbound UDP and TCP 53 to your ISP's resolvers or a public resolver you trust. Block inbound 53 entirely — nothing inside needs to answer DNS for the internet.
  • Authoritative DNS servers: inbound UDP and TCP 53 must be open to the world, because anyone may need to resolve your domains. But recursion must be off: an authoritative server should only answer for zones it owns.
  • Recursive resolvers: inbound 53 should be open only to your own users or networks, never to the whole internet. An open resolver is an amplification weapon waiting to be used.
  • Cloud servers: if the server does not run DNS, close inbound 53. Many cloud images ship with a local resolver listening on 127.0.0.1 only, which is fine — it is not reachable from outside.

One common mistake is blocking TCP 53 while allowing UDP 53. It looks harmless, because most lookups still work. Then a DNSSEC-signed answer or a large response fails, and the failure looks like a random, intermittent outage. Allow both, or expect strange debugging sessions.

Port 53 firewall checklist✓Allow outbound UDP + TCP 53to your chosen resolvers, so names keep resolving✓Allow inbound 53 only on real DNS serversauthoritative servers answer for their own zones only✕Never run an open recursive resolverlimit recursion to your own users or networks✕Never block TCP 53 while allowing UDP 53
The four rules for port 53 on a firewall. Illustration by Cysoro.

How do you troubleshoot port 53 problems?

When a site will not load but your connection seems fine, DNS on port 53 is the first suspect. Work through these steps in order before assuming the site is down.

  1. Test another site. If nothing loads, it is DNS or connectivity. If one site fails, it is probably that site.
  2. Try the IP address. If the site loads by IP but not by name, DNS is the problem.
  3. Run nslookup or dig. Query the domain against your resolver, then against a public resolver like 8.8.8.8. If one answers and the other does not, your resolver is at fault.
  4. Flush the local cache. On Windows, ipconfig /flushdns; on macOS, sudo dscacheutil -flushcache. A stale cached answer can look like an outage.
  5. Check TCP 53. If small lookups work but large or DNSSEC-signed ones fail, TCP 53 is probably blocked somewhere on the path.
  6. Check for hijacking. If a domain resolves to an unexpected address, check your DNS records and registrar account — see our guide to securing your Wi-Fi and home network for the home side of this.

The bottom line

Port 53 is the DNS port: the channel every domain-name lookup travels on, mostly over UDP, with TCP handling the large answers. It is one of the oldest and most important numbers in networking, and it is also one of the most abused, because plain DNS is unencrypted and UDP can be spoofed.

For most people, the practical rules are short: let port 53 out to resolvers you trust, keep it closed inbound unless you run a DNS server, never run an open resolver, and allow both UDP and TCP. If you want to see what your own domain publishes over DNS, start with the free DNS lookup tool.

Frequently asked questions

What is port 53 used for?

Port 53 is used by the Domain Name System (DNS). When a device needs the IP address behind a domain name, it sends a DNS query to a DNS server on port 53 and receives the answer back on the same port.

Is port 53 TCP or UDP?

Both. IANA registers port 53 for TCP and UDP. Most queries use UDP because it is fast and a single packet each way is usually enough. TCP takes over when an answer is too large for UDP, for DNSSEC-signed answers and for zone transfers between servers.

Should port 53 be open on my firewall?

Outbound port 53 to your chosen DNS resolvers should be open, or nothing on your network can resolve domain names. Inbound port 53 should only be open on a server that is meant to answer DNS queries for others, and only for the clients it is supposed to serve.

Is port 53 safe?

Port 53 itself is not dangerous — it is just the channel DNS uses. The risk comes from how it is configured. An open recursive resolver can be abused in DNS amplification attacks, and unencrypted DNS traffic on port 53 can be read or tampered with on the network.

What is the difference between port 53 and port 853?

Port 53 carries plain, unencrypted DNS. Port 853 carries DNS over TLS (DoT), which encrypts the queries between your device and the resolver. Port 443 carries DNS over HTTPS (DoH), which sends queries inside ordinary HTTPS traffic.

Why does DNS use UDP instead of TCP?

Speed. A typical DNS lookup is one small question and one small answer, and UDP sends both without the handshake TCP requires. The tradeoff is that UDP does not guarantee delivery or verify the sender, which is why DNS amplification attacks are possible.

What happens if port 53 is blocked?

Domain names stop resolving. Browsers, email and apps fail with errors like "DNS server not responding" or "server not found," even though your internet connection is fine. If only TCP 53 is blocked, most lookups still work but large answers fail, which causes intermittent, confusing failures.

How can I check if port 53 is open?

On a server, check whether a DNS service is listening with a command like ss -tuln on Linux or netstat -an on Windows, looking for port 53. From outside, send a test query with nslookup or dig against the server's address. Only test servers you own or are authorized to test.

Sources

  1. IANA — Service Name and Transport Protocol Port Number Registry
  2. Microsoft Learn — Network Ports Used by DNS
  3. CISA — Mitigate DNS Infrastructure Tampering
  4. NIST — Domain Name System (DNS) Services: NIST Recommendations for Secure Deployment
  5. RFC 1035 — Domain Names: Implementation and Specification
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against IANA's port registry, Microsoft Learn's DNS ports documentation, CISA's DNS tampering guidance and RFC 1035.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free