How works DNS
DNS maintains a directory of domain names and translates these names into Internet Protocol (IP) addresses. The way DNS works is like activating the contacts section of your smartphone. Do you want John's number? Just type in the name and your phone will search for it for you.
The information received from all domain name servers on the Internet is stored at the Domain Registry operators. Hosting companies and Internet service providers are constantly in contact with Domain Registry operators to obtain updated DNS information.
DNS main function
The primary function of DNS is name resolution. It is an architecture that assigns names to IP addresses so that when a user tries to access another computer on a network, they are directed there.
When you type a web address, for example, iptrooper.net, your Internet service provider looks up DNS, looks up the domain name, translates it into a machine-friendly IP address (for example, 184.108.40.206 is the IP for iplookup.live) and direct your internet connection to the correct website.Let's understand how DNS works, step by step:
Here, we are trying to get access to the website iptrooper.net.
Step 1: Request for Information
Type the domain name (iplookup.live) into your web browser and it will query DNS to find the answer as to where it is located. The DNS resolver is like your intermediary.
Step 2: Root Name Servers
The DNS resolver asks the root name server for the IP address. They don't have the answer to your query, but they know where to find it. The response from the root name servers is the address of the Top Level Domain Name Servers (TLD or Top Level Domain).
In the case of iplookup.live, they are the .LIVE nameservers.
Step 3: Top Level Domain Name Servers (TLD or Top Level Domain).
The DNS resolver now asks the TLD name server for the IP address of the domain name. The TLD name server responds with the address of the authoritative name server for the domain name.
In our example, the .LIVE nameserver will provide the address of get.live's authoritative nameservers.
Step 4: Authorized DNS Servers
Authoritative DNS servers keep DNS records for domain names required for DNS resolution. These records are ideally kept in a zone file by the domain owner or by the technical administrator responsible for managing the functional behavior of the domain name. There are different records within a zone file, for example, the IP address of the server where the website is hosted is represented by an Address Record, commonly called an 'A' record. You can find more information on zone record types here.
Step 5: Recover the Registry
The recursive server obtains the 'A' record for the website from the authoritative nameservers and stores it in its local cache. If someone else is searching for the same website, the information will already be there and you won't have to go through the whole process.
Step 6: Access the Website
The recursive server sends the 'A' record to your computer. The PC saves this record, reads the IP and passes the information to your browser; which then makes the connection to the web server, and you will see the website iplookup.live.
Although it seems like a long and complicated process, it is actually almost instantaneous, it only takes microseconds, for the entire DNS resolution process to take place.
With this system, users looking to visit your website only need to know your domain name. The IP address of the individual server your site is hosted on is irrelevant to them. If updates are made to the website or domain name, the DNS is also updated to point to the IP address of your new server. Your visitors still visit your site using only your domain name; even though your IP address changed. This kind of flexibility is what makes the Internet so powerful.
The DNS lookup is done directly against the domain's authoritative name server, so changes to DNS Records should show up instantly. By default, the DNS lookup tool will return an IP address if you give it a name.