๐ DNS: cheat sheet
๐จ The analogyRinging the operator for a shop's street number, who asks around and writes the answer down for next time.
๐ The regular explanationThe internet's directory. DNS turns names like www.shop.com into IP addresses by asking a chain of servers (root, top-level domain, authoritative) and caching every answer for a set time.
- You know the shop's name, www.shop.com, but not its street number. So you ring the operator and ask.
- The operator doesn't know either, so they ask head office, which only knows who looks after names ending in .com.
- The .com desk doesn't have the street number, but knows whose book does, the shop's own book.
- The shop's own book has the real answer, number 93.184.216.34, good for an hour.
- The operator writes it down in case anyone else asks, and tells you. Now you can walk to the right house.
- You ask for the shop's number. The operator has to look it up properly the first time, and notes it for an hour.
- Your neighbour asks for the same shop a minute later. The operator answers straight from the notes, no calls needed.
- Your own laptop keeps a little notebook too, so asking again doesn't even need a phone call.
- The shop moves to a new street number. Anyone with old notes keeps going to the old house until their hour runs out.
- Once the hour is up, the operator rubs out the old note and asks the shop's book again, getting the new number.
- The book's entry for www.shop.com just says "see branch-shop.net". It's a nickname that points to another name.
- The branch shop's entry gives a street number close to you, so your visit is quick.
- The postman asks a different question, "where do letters for shop.com go?" The book has a separate line for that.
- The book also has a notes column, where the shop writes things like "only these postmen really work for us".
๐งฉ Key questions
- The operator doesn't have every number in the world. Who do they ask first?
- Head office, which knows which desk handles names ending in .com. Head office points to the right desk, the desk points to the shop's own book, and the book has the answer.
- The shop moves to a new street number. Why do some people keep going to the old one?
- They have an old note whose hour isn't up yet. Writing answers down saves time, but notes stay until their hour is up.
- A line in the shop's book says "look under this other name instead". What kind of line is it?
- A nickname line. The book has different kinds of lines: the number, nicknames, where post goes, and notes.