Why do we need a system for managing domain names?
Imagine for a moment what the Internet would be like without a domain name system. It would be just like a phone number. If I had to create an audio commercial for Take Up Code and couldn’t use takeupcode.com, well, I’d probably have to repeat my IP address a lot in order for you to remember it. Do you think you could remember to visit 220.127.116.11? It’s actually less digits than a typical phone number but they’re completely random as far as a customer is concerned. At least phone numbers have similar beginnings for local numbers.
That type of address of 4 numbers separated by dots is called an Internet Protocol address or just IP address for short. Specifically, it’s an IPv4 address. There are newer IPv6 addresses but they’re bigger and much more complicated. I’ll talk about IP addresses in a future episode. For now, just think of them like a phone number. When you press those numbers on a phone, you get connected to whoever you’re trying to reach.
And like the phone number has an easier way to remember the number by using words, so IP addresses also have matching domain names.
When you see a domain name like www.takeupcode.com, what may not be immediately obvious is that it’s divided into a hierarchy that begins on the right with com, then goes to takeupcode, and finally, to www. There can be many more levels but 3-4 is common. The whole point of a hierarchical name like this is to identify a specific computer on the network. Of course, if you already know the network address, then you could just use that directly. But DNS gives you some added benefits beyond just giving you an easier name to remember.
Your browser usually starts by asking your operating system to resolve the name. The operating system needs to be connected to a network somehow and as part of joining that network, there will usually be a computer responsible for resolving names somewhere on the network. This is known as a name resolver or sometimes simply as a DNS server. The name resolver could either be specified directly with its IP address or assigned dynamically when your computer joins the network.
The name resolver will start with the root name servers. You might think this means the com part, but as far as DNS is concerned, there’s an extra dot that comes after the com. This is the root and there are several root servers that can respond to requests. These servers will have no idea where to find www.takeupcode.com but can tell you where to go to get answers for any com names.
So the name resolver gets an address for a com name server and it asks for www.takeupcode.com. The com server also has no knowledge of this but it does have some glue that tells your name resolver where it can find a name server with more information. You see, whenever you register a domain name, you don’t register the name directly for some server IP address where you intend to setup shop. You register the domain and provide a couple name servers. One name server is a backup. These name servers are usually provided by your registrar but you could setup your own if you want.
Your local name resolver now has an address for a name server and asks it for www.takeupcode.com. In this case, it has an answer. And this is called an authoritative answer. If there had been more nesting of names, then the process might sometimes need to continue. At each point, the local name resolver gets closer to finding out the address of the name it’s trying to resolve.
There’s some more details included in the audio so make sure to listen.