DNS explained
What is DNS
DNS stands for Domain Name System, is to translate the host name to IP address since human beings are unable to remember a long string of digits.
Why is DNS so important
Without DNS, the Internet will collapse, you will have to pay your bill in the department or shopping in the store or view the TV schedule on the newspaper.
How it works?
- When you type
www.example.com
in your web browser, the browser will add a dot at the end of the url, that means the actual url you're visiting iswww.example.com.
. The dot means the name space for the ROOT. Why the dot at the end is so important, because it's where it all begins. - When you first search for
www.example.com.
, your browser and your OS will first determine if they know what the IP address is already. It could be configured on your computer or it could be in the memory, what the cool kids call cache. - So the browser asks the OS and if they both don't know where
www.example.com.
is, what will happen next? The OS is configured to ask a resolving name server for IP addresses it does not know. - This resolving name server is the workhorse of the DNS lookup. It is either configured manually or automatically within your OS. Your OS asks (or queries) the resolving name server for
www.example.com.
- The resolving name server may or may not have this in memory or you know, cache. Never mind.
- The only thing that all resolving name servers should know, is where to find the root name servers. Yes, the enigmatic dot that appears at the end of every domain name you type into that address bar.
- The root name servers will reply with "I don't know, but I do know where to find the com name servers. Try there."
- The com name servers are called the Top Level Domain name servers or TLD name servers.
- The resolving name server then takes all of this information from the root name servers, puts it in its cache, and then goes directly to the com TLD name servers.
- When the resolving name server queries
www.example.com
, the TLD name servers respond, "I don't know, but I do know where to find the Example.com name servers. Try there." - This next set of name servers are the authoritative name servers.
- So how did the com TLD name servers know which authoritative name servers to use? With the help of the domain's registrar. When a domain is purchased, the registrar is told which authoritative name servers that domain should use. They notify the organization responsible for the top level domain(the registry), and tell them to update the TLD name servers.
- Anyway, the resolving name server takes the response from the TLD name server, stores it in cache, and then queries the Exmaple.com name servers. At this point, the authoritative name server will say, "Hey, I know where that is! Tell your browser to go to the IP address
192.168.1.1
!" - The resolving name server taks this information from the authoritative name server, puts it in cache, and gives the reply to the OS. The OS then gives this to the browser. And the browser then makes a connection to the IP address requesting the web page for
www.example.com
. - While the process seems complex, the whole cycle takes less than it takes you to blink an eye. DNS was designed to work extremely fast and efficiently. It is an integral part of the Internet. Once you understand this, you can clearly see the many different facets and organizations that are responsible for a single DNS lookup.
Recap
resolving name server -> root name server -> TLD name servers -> authoritative name servers
网友评论