DNS needs TCP as well as UDP for reliable operation. Larger answers, including some signed responses, may require TCP fallback. Allowing only UDP port 53 can make simple lookups work while DNSSEC or other larger queries fail.
IN THIS ARTICLE
What you need before you begin
Identify whether you are diagnosing a recursive resolver, an authoritative server or the network between them. Record the server address, queried name/type and observed failure. Make firewall changes only on infrastructure you are authorised to administer.
01 Check DNS over TCP when large or signed answers fail
- Run the same DNS query over the usual UDP path and explicitly over TCP. Query the actual affected nameserver or resolver so results are comparable.
- Inspect a UDP response for truncation. A truncated answer can instruct a client to retry over TCP, so successful receipt of that small response does not prove the lookup can finish.
- On the DNS server, verify that the daemon listens on both protocols and the correct public IPv4/IPv6 interfaces. Check local firewall and upstream security-group rules separately.
- Permit the necessary DNS TCP traffic for the server's role without opening recursive service to unauthorised clients. Public authoritative service and public recursive access are different policies.
- Retest from an external network and inspect relevant logs. Keep security controls for transfers and administration separate from normal TCP query access.
02 Read-only diagnostic example
dig @ns1.example.net example.com SOA +tcp
dig @ns1.example.net example.com DNSKEY +dnssec +tcp
Replace example names and documentation addresses with the exact authorised service details. These commands query existing configuration; they do not change DNS.
Confirm the expected result
Both a small ordinary query and a larger relevant query should succeed over TCP. Confirm routine resolution, DNSSEC validation where used, and access from every advertised address family.
Troubleshoot unexpected results
If TCP connects but a query is refused, inspect DNS service policy rather than only the firewall. If TCP times out, compare listener, routing and packet-filter evidence before changing the DNS records themselves.
A common question
Does allowing TCP port 53 expose unrestricted zone transfers?
It makes the transport available, but transfer authorisation remains a DNS-server policy. Keep AXFR/IXFR restricted to intended secondaries and authenticated peers. Blocking all TCP DNS is not a sound substitute for correct transfer access controls.