What About Domain Names
I hope my explanation above is pretty clear. So one thing that I did not mention emphasize above is the address as I feel it’s obvious that when you send a mail, you need to recipient information like name and address.
As computer network resembles how post office works, all the datagrams need to have an address (in case of UDP). In TCP, you need an address to make a connection to. In computer, all address are pretty much numbers. We human, however, are good with names. Therefore, there’s an obvious disjoint here. Let’s introduce Domain Name System (DNS).
Domain Name System (DNS) is pretty much an address translation service. You give it a name, it returns you the address as needed by computer to do its thing. In other words, it’s like a phone book. You may not know the phone number of a particular person, but you know the name. In the phone book, you associate a name with a phone number. In the internet, you associate a domain to an IP address.
In your phone book, you can have James phone number as 415-555-1234 and on someone else’s phone book, James’ phone number maybe 510-123-4567. That is fine as long as you only use your own phone book, and someone else use theirs. On the internet, however, you can’t have the same name resolving to different address. Thus, they’ve setup a registration service. It is basically a way for you to register a name so that no conflict of names exists (like in the case of James above). For that, you have to pay some companies for their services. One company I like to use is GoDaddy.
Name Servers & Resolving Domain Names to an Address
Have you seen address not found problems while browsing a website before? Read on and I’ll explain you why it happens.
When you type a domain address in your browser, for example, your computer tries to resole it to the eqivalent IP address so that it can connect. here’s what your computer does behind a scene when making connection.
- See if the domain address is listed in resolv.conf file. You can think of resolv.conf as your own personal phone book. This file is always consulted first.
- If it’s not on resolv.conf, pass query to your DNS server as specified in your settings. DNS stands for Domain Name System. It ia a system where you give a domain name and it will return you the corresponding IP address of the domain name.
- DNS returns you the IP address.
- Now that your computer knows the IP address, it can then make connection to it.
So now you know the prerequisite of your computer making connection, you can debug your connection further when you have address not found error above. It may not be that your internet is down. It may just be that the domain address really doesn’t have a corresponding IP address, or that your DNS server is down.
30,000 feet view of how Domain Name System (DNS) works
So let’s assume that you want to go to this website, www.microshell.com. First your computer needs the IP address of www.microshell.com so that your web browser can make connection to the server to download this page.
- First, your computer will ask your DNS server if it knows www.microshell.com.
- Chances are, your DNS server doesn’t know about www.microshell.com. So it forwarded the request to the next level domain, the com root domain.
- com root domain doesn’t know about www.microshell.com. However, it knows that Microshell DNS server knows www.microshell.com. So it tells your DNS server that Microshell DNS server knows about it.
- Then your DNS server asks Microshell DNS server about www.microshell.com.
- Microshell DNS server knows about www.microshell.com and returns the IP address
- Your DNS then returns the IP address that it got from Microshell DNS server.
- We just resolved www.microshell.com to its equivalent IP address.