---
title: "Only large DNS answers fail: truncation and blocked TCP port 53 | Proofline"
description: "When a DNS answer does not fit the UDP size the client advertised, the server sets the TC bit and the client must retry over TCP port 53."
url: https://proofline.sh/learn/dns-truncated-response-tcp-blocked/
---

[Learning center](/learn/)

# Only large DNS answers fail: truncation and blocked TCP port 53

When a DNS answer does not fit the UDP size the client advertised, the server sets the TC bit and the client must retry over TCP port 53. If a firewall, security group or proxy blocks TCP 53, or the client library never retries over TCP, only the large answers fail: names with many addresses, long TXT records, DNSSEC responses. Query the same name over UDP without the retry and then over TCP to see which half breaks.

Network outages The Proofline team November 23, 2026 6 min read

## The symptom

Most names resolve, and a few fail every time from one network:

-   A name behind a large load balancer or service discovery record with many addresses fails, while a name with one address works.
-   TXT lookups, such as domain verification or SPF checks, fail or return nothing.
-   A signed zone fails from a validating resolver while unsigned names work, because signatures make answers larger.
-   Pods built on an old Alpine image fail to resolve a name that other images resolve.

Size, not the name, is the common factor.

## Why size matters

RFC 1035 limits plain UDP DNS messages to 512 octets and defines the TC (truncation) bit: the message was truncated because it was longer than the transport allows. EDNS(0), RFC 6891, lets a client advertise a larger UDP payload size so more answers fit without TCP. When the answer still does not fit, the server truncates it and sets TC, and the client is expected to retry over TCP. [RFC 1035](https://www.rfc-editor.org/rfc/rfc1035) · [RFC 6891](https://www.rfc-editor.org/rfc/rfc6891) · [RFC 7766](https://www.rfc-editor.org/rfc/rfc7766)

RFC 7766 makes TCP support a required part of a full DNS implementation for both authoritative and recursive servers, and it warns that failure to support TCP, or blocking DNS over TCP at the network layer, will probably result in resolution failure or application-level timeouts. DNSSEC made truncation at 512 bytes commonplace. [RFC 7766](https://www.rfc-editor.org/rfc/rfc7766)

So there are two ways for the retry to fail:

-   The TCP path is blocked: a security group, network ACL, firewall or forwarder allows UDP 53 and not TCP 53, between the client and its resolver or between a resolver and the next server.
-   The client never retries. Kubernetes documents that musl, as shipped in Alpine 3.17 and earlier, did not fall back to TCP, so any DNS answer above 512 bytes failed. [Kubernetes DNS known issues](https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/)

## Query over UDP, then TCP

dig retries over TCP by default when it sees TC. `+ignore` turns that retry off so you can see the truncated reply, `+bufsize` sets the advertised UDP size, and `+tcp` sends the query over TCP from the start. The statistics at the end of dig's output include the size of the reply. [dig manual](https://bind9.readthedocs.io/en/latest/manpages.html)

```
# Inside the failing container or host, against the resolver it uses
cat /etc/resolv.conf

# UDP only, no TCP retry: look for the tc flag in the header
dig @RESOLVER_IP NAME A +notcp +ignore
dig @RESOLVER_IP NAME A +notcp +ignore +bufsize=512

# TCP from the start
dig @RESOLVER_IP NAME A +tcp

# The default behavior: UDP, then TCP if truncated
dig @RESOLVER_IP NAME A
```

If the TCP query hangs, check whether TCP 53 opens at all:

```
nc -vz -w 3 RESOLVER_IP 53
```

Repeat the pair against the next hop when you can reach it, such as the resolver your resolver forwards to, to find which leg drops TCP.

## Read the result

| UDP with `+ignore` | `+tcp` | Default | Points to |
| --- | --- | --- | --- |
| Answer, no `tc` | Answer | Answer | Not size; look elsewhere |
| `tc` set | Times out | Times out | TCP 53 blocked on this leg |
| `tc` set | Answer | Answer | DNS path is fine; the client library does not retry over TCP |
| `tc` set | SERVFAIL | SERVFAIL | The resolver cannot use TCP to the next server |
| No reply | Answer | Answer | UDP is the broken half, often a fragmented large reply that is dropped |

The third row is the old-musl case. dig in the same container works because dig has its own resolver code; the application's library does not retry. Compare with `getent ahosts NAME` in a glibc image, or check the image's base version.

## Where TCP 53 is commonly blocked

Look for rules that name UDP 53 alone:

-   Security groups and network ACLs written for "DNS" with only UDP. Route 53 Resolver outbound endpoints, for example, need a security group that allows both TCP and UDP on port 53 to the target resolvers. [Resolver outbound endpoints](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-overview-forward-vpc-to-network.html)
-   Firewalls between a cloud network and on-premises DNS servers that receive forwarded queries.
-   Kubernetes NetworkPolicies that allow egress to the cluster DNS on UDP 53 and forget TCP.
-   Custom resolvers or forwarders configured to listen on UDP only.

## A worked example

This example is illustrative. The `orders` service resolves `inventory.example.internal`, which a service-discovery system publishes with 120 A records, one per instance. From Tuesday, after a NetworkPolicy change, lookups fail with timeouts; `payments.example.internal`, with two records, still resolves.

| Query from an `orders` pod | Result |
| --- | --- |
| `+notcp +ignore`, inventory | NOERROR, `tc` flag, 0 answers |
| `+tcp`, inventory | timed out |
| `+tcp`, payments | timed out |
| `nc -vz -w 3 10.96.0.10 53` | timed out |
| Same `nc` from a pod in another namespace | connected |

The truncated reply shows the answer did not fit. TCP to the cluster DNS fails from this namespace only, and for every name, not only the large one; small names never needed TCP, so nobody noticed. The new policy allows egress to port 53 over UDP only. The DNS servers and the record are fine.

In a second case, the same 120-record name fails only in the `checkout` service. `+tcp` works from a `checkout` pod, and `getent ahosts` fails. The image is built on Alpine 3.16. dig succeeded because it retries over TCP itself; the application's resolver does not. Rebuilding on a newer base image is the fix, not a network change.

## Limits

`+bufsize` changes what you advertise, not what the server will send or what the path can carry. A server can still truncate below your value, and a path that drops fragmented UDP can lose large replies that never set TC. dig's default reply handling hides truncation, which is why the checks use `+ignore`.

The leg that fails may be beyond your resolver. If your client's queries go through CoreDNS, then the VPC resolver, then a forwarder, TCP has to work on each leg that handles a truncated answer. For the reading of SERVFAIL and timeouts in general, see [NXDOMAIN, SERVFAIL or no answer](/learn/dns-nxdomain-servfail-timeout/); signed zones that fail for signature reasons are covered in [DNSSEC SERVFAIL](/learn/dnssec-validation-servfail/). For the method across dependency layers, see [runtime dependency failures](/learn/runtime-dependency-failures/).

## Questions

### Does DNS use TCP?

Yes. TCP is required for a full DNS implementation, and clients use it when a UDP answer is truncated, as well as for zone transfers. Allow both TCP and UDP on port 53 wherever DNS traffic flows.

### Why does dig work while my application fails to resolve the same name?

dig retries over TCP when the reply is truncated. Some resolver libraries, such as musl in older Alpine releases, did not. Run dig with `+notcp +ignore` to see whether the answer is truncated, then test the application's own lookup.

### How do I know a DNS answer was truncated?

Query over UDP with `dig +notcp +ignore` and look for the `tc` flag in the header. Without `+ignore`, dig retries over TCP and shows you the full answer instead.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [DNS lookup failed: NXDOMAIN, SERVFAIL, NODATA or no answer?](/learn/dns-nxdomain-servfail-timeout/)
    
    Network outages The Proofline team November 23, 2026 6 min read
    
-   ### [SERVFAIL from a validating resolver: is DNSSEC broken?](/learn/dnssec-validation-servfail/)
    
    Network outages The Proofline team November 23, 2026 5 min read
