The magic of the internet has never really stopped to fascinate me. The internet is simple but genius. It simply works yet very few people understand exactly what goes behind the scenes when they visit a website such as Facebook.
So today, I want to explain simply but in detail some of the intricate workings of the internet. I have not worked with an Internet Service Provider (ISP) or telecom, but my current work requires deep understand of the pieces that form the internet. So I've been reading around and tinkering with things a lot.
DNS, The internet's phone book
Many people are already familiar with what a phone book really is. You have it on your phone. Whenever you want to dial a friend's phone number, you look up their name from your phone book and then dial their number.
Why do you need a phone book?
This question might seem obvious at first, but It'll help us understand how the internet actually works. So you need that phone book because its easier to remember your friend's name than their phone number. Isn't that true?
Dush --> 0782-123-456
Vic --> 0775-123-456
The internet works in similar manner.
IP addresses and domain names
Whenever you visit a website like facebook.com, this is akin to you calling your friend from your phone. The difference is that your friend's name and phone number are stored in your phone -- for good reasons. First, for privacy reasons. Your friend wants their phone number only known to you and a few other trusted friends. Secondly, your phone's memory can store all your friend's phones and even have some space memory for photos, videos etc.
But when it comes to the internet, website names and their respective "phone numbers" can't all be stored in your computer. There are more than 1 billion websites in the world.
The website name is what we call a "domain name" where as its respective phone number is what we call an "IP address".
So Facebook's domain name is facebook.com. What's "facebook"? what's the dot(.) and what's .com? I won't get deep into the anatomy of a domain name, but for now all you need to know is that like your friend's phone number, a domain name must be unique across the internet. Nobody else should have a website called facebook.com.
facebook.com --> 188.8.131.52
google.com --> 184.108.40.206
An IP address on the other hand is a numeric representation of a computer's address on the internet. Have you seen your techie friend type something like 192.168.1.1? Or even yourself when you need to access your router's web management interface, you could have entered it.
The thing to remember here is that computers communicate with each other using IP addresses not domain names.
DNS servers, the phone book of the internet
Remember I said there are about 1 billion websites in the world. Your computer can't store the whole "contact book" for all these websites. This is where DNS name servers come in.
These servers store a list of website domains along with their IP addresses. Usually, these are run by your internet service provider or your computer IT department. Chances you don't even need to know about them because your computer automatically picks them up from whatever network it's hooked to.
When you type in facebook.com in your browser's address bar, your browser or computer will ask the nearest name servers for the IP address of Facebook. Once it gets it, your browser will connect with Facebook servers and start serving web pages. If you can't connect to a DNS name server, as you might have guessed, you won't be able to surf.
When you need to start a website or say a blog of your own like mine davidokwii.com, you need to get a unique name for your blog. There are over 1 billion websites on the internet, so you simply can't just dream up anything and hope that it works. Your website name must be unique, meaning nobody else has taken it. That name should be released back to the public domain once you are no longer interested in it so that other people can take it up. Lastly that name should be added in the global address book so that it can be queried by any computer on the internet.
Who's responsible for all this stuff?
They are called registrars. You have probably heard of godaddy, name.com, enom, namecheap or Infinity computers. These guys will secure your favorite domain at a fee. After that, this name is pointed to a remote server on the internet having your website files by way of a unique IP address. Usually, your hosting company or web developer knows how to do this.
Wrapping it all up
The internet is genius because of its simplicity. It's easy to block by authoritarian regimes but equally easy to circumvent any such censorship. The management of the internet addressing scheme (the contact book explained above) is currently managed by the US government, but there are talks to move it to global community of multiple stakeholders. We are not exactly sure how that will pan out.
Subscribe to David Okwii dev blog
Get the latest posts delivered right to your inbox