Networking - DNS

Back to Course

Lesson Description

Lession - #1378 Working of DNS

Working of DNS

If you wanted to go to a certain website you would open up your web browser and type in domain name of that website. Let us usegoogle.com. Now technically you really don't have to type ingoogle.com to retrieve Google web page, you can just type in IP address rather if you already know what google’s IP address is, but since we aren't accustomed to memorizing and dealing with numbers, especially when there are millions of websites on Internet, we can just type in domain name instead and let DNS convert it to an IP address for us.

So back to our illustration, when you typegoogle.com on your web browser DNS server will search through its cache to find a matching IP address for that domain name, and when it finds it it'll resolve that domain name to IP address of Google web site, and once that's done also your computer is able to communicate with a Google web server and retrieve the webpage.

So DNS basically works like a phone book, when you want to find a number, you don't look up number first, you look up name first also it'll give you the number. So to break this down into further detail, let us examine the way that DNS takes. So when you type ingoogle.com in your web browser and if your web browser or operating system can not find IP address in its own cache memory, it'll send a query to next level to what's called resolver server. Resolver server is basically your ISP or Internet service provider, so when resolver receives this query, it'll check its own cache memory to find an IP address forgoogle.com, and if it can not find it it'll send query to next level which is root server. The root servers are the top most server in the DNS hierarchy.

There are 13 sets of these root servers froma.root-servers.net tom.root-servers.net and they're strategically placed around world, and they're operated by 12 different organizations and each set of these root servers has their own unique IP address. So when root server receives query for IP address forgoogle.com, root server isn't going to know what IP address is, but root server does know where to send resolver to help it find IP address. So root server will direct resolver to TLD or top- level domain server for. com domain. So resolver will now ask TLD server for IP address forgoogle.com.

The top- level domain server stores address information for top- level domains such as. com and. net,. org, and so on. This particular TLD server manages. com domain whichgoogle.com is a part of. So when a TLD server receives query for IP address forgoogle.com, TLD server isn't going to know what IP addresses forgoogle.com. So the TLD will direct resolver to coming and final level, which are authoritative name servers. So once again the resolver will now ask authoritative name garçon for IP address forgoogle.com. Authoritative name server or servers are responsible for knowing everything about domain which includes IP address.

They're final authority.

So when the authoritative name server receives query from resolver, name server will respond with IP address forgoogle.com. And finally, resolver will tell your computer IP address forgoogle.com and also your computer can now retrieve google web page. It's important to note that once resolver receives IP address, it'll store it in its cache memory in case it receives another query forgoogle.com. So it doesn't have to go through all those steps again.

DNS servers has different types of records to manage resolution efficiently and provide important information about a domain. These records are the details which are cached bu DNS servers. Each records have a TTL( Time To Live>
value in seconds associated with it, these values set time for the expiration of cached record in DNS server which ranges to 60 to 86400 depending on the DNS provider.

A records – points to IPv4 address of machine where website is hosted
AAAA records – points to IPv6 address of machine where website is hosted
MX – points to email servers
CNAME – canonical name for alias points hostname to hostname
ANAME – Auto resolved alias, works like cname but points hostname to IP of hostname
NS – nameservers for subdomains
PTR – IP address to hostname
SOA – containing administrative information about the DNS zone
SRV – service record for other services
TXT – Text records mostly used for verification, SPF, DKIM, DMARC and more
CAA – certificate authority record for SSL/ TLS certificate