Skip to Content

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!

panel 1:

In an internal network (like in a company or school), sometimes you can connect to a machine by just typing its name, like this:

$ ping labcomputer-23

Let’s talk about how that works!

many DNS lookup functions support “local” domain names

browser, represented by a box with a smiley face: where’s lab23?
function, represented by a rectangle with squiggly lines: where’s
arrow pointing to resolver (server) represented by a box with a smiley face holding a magnifying glass

(the function appends a base domain to the end)

the base domain is called a “search domain”

On Linux, search domains are configured in /etc/resolv.conf

Example: search this tells getaddrinfo to turn lab23 into

getaddrinfo doesn’t always use search domains

It uses an option called ndots to decide.

options ndots:5

this means “only use search domains if the domain name contains less than 5 dots”

search domains can make DNS queries slower

browser: where’s
getaddrinfo, represented by a rectangle with squiggly lines: okay, first I’ll try

this is silly but it can happen!

avoid search domains by putting a “.” at the end

Use instead of

Illustration of a smiling stick figure with curly hair.

person: “local” domain names like this mostly exist inside of big institutions like universities

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)