Someone on LinkedIn asked for a good analogy for how the internet works, what is a static IP address, what is a dynamic one and what domain names.
I slept on it and I think I have come up with a fairly decent story to explain it to a computer illiterate.
Imagine your computer as a person and the internet as a place.
But for the computers in the Internet to communicate imagine that they can only do so by using telephone 1.
Now imagine that each ISP runs a hotel with a static telephone in every room. Like in real life, every telephone has a its own number. So, if a computer wants to talk to other computers on the Internet, he has to check into a hotel (connect to the ISP) and get his own room with his own telephone (IP) number.
And, oh, how much do computers have to talk to each other! Send each other photos and documents, share what has happened to them on vacation, the latest news and gossip, occasionally even try to find some useful information. Each computer talks to a many many computers on the Internet. Some love to lecture a lot (servers), while others rather listen and occasionally ask something (desktops, laptops).
So, how exactly does a computer get his telephone number. Let's look at this step by step. It's not unlike checking into a hotel in real life, actually.
First the computer walks into the hotel (connects to the ISP) and goes right towards the reception. The receptionist's name is usually DHCP and in most hotels he asks the computer to identify itself. Some receptionists/hotels only ask the computer to tell his name (username and password), while others are more strict and want its unique ID number as well (MAC address of the computer's network card).
After that the receptionist (DHCP) takes a look which room numbers are still available in the hotel and shows the computer to the first empty room he can find, giving him the (IP) number. Because there are a lot of rooms in the hotel, every time the computer walks into the hotel (connects to the ISP) it's more likely than not that he will get a different room number – this method of getting a room (IP) number is called a dynamic IP.
Of course the lives of the more popular computers who do a lot of lecturing (servers) would be quite complicated if their room/telephone numbers would change often, there's an option for getting a so called static IP. And this goes like this: when the computer introduces itself to the receptionist, the latter checks if he either has it noted in his books that this computer always lives in the same suite or if the computer has any preferences of its own. This way the computer always gets the same i.e. static (IP) number and is easier to find by the rest.
So, now we have all the computes in different hotels calling each other on the phone and chatting. But it's still awfully hard to remember all these computers' numbers when you have to call anyone to exchange any information.
At first each computer used their own little address book (
hosts file) in which they put names of the computers next to their numbers. So instead of having to remember to dial 220.127.116.11, the computer just wrote the number into his address book and put the computers (domain) name next to it: google.com. Now every time it wants to go and talk to google.com, it doesn't need to think about his complicated (IP) number, but can look it up.
In due time, when more and more computers moved to the Internet and started talking to each other each computer had an enormous work to do, by just adding everyone to his, now humongous, address book and then reading it. So, the clever cogs invented the DNS. This works not unlike a concierge. Now instead of having to flip through an address book, when a computer wants to get in touch with another computer, it just takes up the phone and says to the concierge "Please connect me with flickr.com". The concierge knows that flickr.com lives in the room 18.104.22.168 and patches the computer through.
And of course, as is typical for concierges, they are always up to date – always sharing between themselves which new celebrity got a room where. So asking any concierge in any hotel, will give the right (IP) number of any computer with a (domain) name, staying at any hotel in the Internet.
Of course, telephone lines are not the only carrier for TCP/IP (i.e. internet) traffic. It is just an analogy. ↩