Skip to Content
Navigation:

A stick figure smiling

Here's a preview from my zine, How DNS Works! If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!

Image of a comic. To read the full HTML alt text, click "read the transcript".

browse more comics! get the zine!
read the transcript!

If you manage servers, sometimes DNS just breaks for no obvious reason

Illustration of a smiling stick figure with curly hair.

person: TCP DNS is an uncommon but VERY annoying cause of DNS problems! Let’s learn about it!

DNS queries can use either UDP or TCP

A UDP DNS response has to be less than 4096 bytes. UDP is the default.

TCP can send an unlimited amount of data. It’s only used when UDP wouldn’t work.

large DNS responses automatically use TCP

speech bubble 1: here’s a UDP DNS query!
speech bubble 2: sorry, my response is too big to fit in a UDP packet! get the rest with TCP!

what’s in a giant DNS response?

person: I’ve seen responses with hundreds of internal server IP addresses (for example when using Consul)

how not supporting TCP DNS can ruin your day

  1. your server is happily making UDP DNS queries
  2. one day, the responses get bigger and switch to TCP
  3. oh no! the queries fail!

2 reasons TCP DNS might not work

  1. some DNS libraries (like musl’s getaddrinfo) don’t support TCP. This is why DNS sometimes breaks in Alpine Linux.
  2. it could be blocked by your firewall. You should open both UDP port 53 and TCP port 53.

Saturday Morning Comics!

Want another comic like this in your email every Saturday? Sign up here!

I'll send you one of my favourite comics from my archives every Saturday.
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)