How DNS Works

A Better Analogy For Explaining DNS?

DNS Analogy

The analogy typically used to explain what DNS does is to compare it to a Phone Book. Which isn’t a great analogy, when you look at how DNS works.

I think I have a better analogy. The downside of my proposed analogy, is that it requires some additional explaining - although I suspect people coming out of school today aren’t very familiar with phone books anymore either…

Here is my suggestion for a better analogy…

Canada’s Postal Code System.

Allow me to elaborate.

In Canada, we address our like so:

A postal code is a 6 character alpha numeric code, with a space between the thrid and fourth characters. They always start with a letter, and they alternate letter and number.

For example, Vancouver City Hall’s Postal Code is
V5Y 1V4

Let’s break down postal codes, and see why this is a better analogy for the DNS system.

Postal Codes are used to sort mail - all the Postal Codes in BC start with V. All of the Postal Codes in Ontario start with P. (Quick Canadian Geography aside, BC and Ontario are Provinces, they are generally equivalent to US States, if that is relevant. Also BC is 364,764 sq mi, Texas is only 268,597 sq mi.) This first letter tells the mail sorting system what large geographic section of the country to route the mail to.
The first three characters - V5Y in our example - represent a section of the city. Cities over a certain population will have many different valid combinations for the first three characters. From maps I’ve looked at, Vancouver has around 29 different codes for the first three characters.

The last three characters of the postal code - 1V4 - represent a specific address or a range of addresses. In the case of city hall, it is likley a specific address.

How does this make for a better analogy? I’m glad you asked.

DNS is a hierachical system, with searches (assuming results aren’t cached) starting from the right of the name and working to the left. Using as our example, we start our lookup by asking the Root DNS servers (represented by a “hidden” ‘.’ at the end of the name) about what servers to ask to get information about the .com part of the name. One of the Root servers will return some options for .com DNS servers.
Our query then goes to the .com DNS servers and asks about
A .com DNS server will respond with’s DNS servers.
The process is repeated looking for the server called www, by asking’s DNS servers for the answer.

Stated another way, we are refining a search by asking each level of a hierarchy for more specific information, until we get the specific answer we need - moving from most broad to most specific.

And that is why a Postal Code is a better analogy than a Phone Book. With a Phone Book you make an alphabetical search based on a name (white pages) or an alphabetical search based on name in a business category (yellow pages). The end result is a phone number to contact a person/business - which is basically what DNS does, but it doesn’t convey the method of the search accurately. DNS is actually starting with a very broad search scope and narrowing down the search space as it moves from one level down to the next. In the end you get an IP to communicate with, which in IPv4 kinda sorta looks like a phone number, if you squint hard enough. But IPv6 is coming soon (any day now, I’ll just sit here waiting for it, yup, just a little bit longer…) and no one would confuse an IPv6 address for a phone number. It’s unlikely they would confuse it with a Postal Code, either, but they both use numbers AND letters, so that should also count for something.

comments powered by Disqus