What is DNS and How Does It Work? : A Definitive Guide with Best Practices & REAL-TIME Examples
Last updated on 04th Nov 2022, Artciles, Blog
- In this article you will learn:
- 1.What is Domain Name System or DNS.
- 2.How Does DNS Work.
- 3.Why is DNS Cached?
- 4.Conclusion.
What is Domain Name System or DNS?
- A Domain Name System (DNS) first emerged in an early 1980s. It represents the system of interconnected servers that save a registered domain names and Internet Protocol (IP) addresses.
- As an Internet grew, it became an unavoidable part of a online interaction. The majority of internet users are not even aware of a DNS and the huge favor it does us. Without a DNS cannot access any website by typing the URL in a browser.
- Computers talk to each other using a IP addresses. Since humans cannot be memorize thousands of a strings of numbers, have to use domain names instead of an IP addresses. It is much simpler to remember to a type into the browser .
- When need to visit a website, computer needs to know an exact IP address; it does not care about a domain name.
- DNS keeps a record of all domain names and also associated IP addresses. When type in a URL in the browser, DNS resolves a domain name into an IP address.
- In the other words, DNS is service that maps a domain names to the corresponding IP addresses.
How Does DNS Work?
DNS is at a core of Internet use today.The latest report shows there were 342.4 million domain names in third quarter of a 2018 and would have been lost without a DNS to resolve them into the IP address.When need to call someone using a cell phone it is highly unlikely punch in an exact phone number. Instead, load the contact list and search using a person’s name. DNS does same thing when need to load a website.Resolving domain name or hostname goes through a several various phases.On a some occasions, DNS resolving is the one-step process while on other it involves contacting the multiple DNS servers.
Why is DNS Cached?
DNS caching or flushing is the effective way to reduce a potential DNS queries towards DNS nameservers. This speeds up a domain name resolving procedure.Caching happens at a multiple locations. This includes the computer sometimes routers, while all the DNS servers have their own databases with cached information.
Step 1 – Send Request to Resolve Domain Name:
When browser in order to load a webpage computer asks for an IP address. Computers do not know in advance where can find a necessary information, so they try searching through a DNS cache and any available external source.
Step 2 – Search for IP Locally:
Before going an externally, computer loads a local DNS cache database to see if already requested an IP for that domain name. Each computer has a temporary cache with most recent DNS requests and attempts to the connect to online sources.When a DNS cache has IP data for a website that are trying to connect to, the page loads immediately. DNS cache an expedites this lookup process since a computer contains information it needs and does not have to forward a request to ISP.
Step 3 – Contact ISP and its Recursive DNS Server to Resolve Domain Name:
A computer’s local DNS cache database does not always contain a necessary data to resolve domain name. In that case, request goes further to Internet Service Provider (ISP) and DNS server.Once it gets request, a resolver looks in its records to provide a correct IP address. When necessary information is present in ISP server’s cached records, computer gets back the IP and connects to website. If ISP’s recursive DNS server cannot be resolve a domain name, it contacts other DNS servers to provide an information back to .This is why call them a recursive servers. Each Internet Service Provider has at least a secondary DNS server setup to an ensure a maximum high availability of a service.
Step 4 – Ask Outside in DNS Servers to Provide IP Address:
These are an iterative a DNS queries.When DNS client sends such a request, first responding server does not provide a needed IP address. Instead, it directs request to the another server that is lower in a DNS hierarchy, and that one to the another until an IP address is fully resolved. There are a some stops in this process.
Root domain nameservers: Root servers are themselves do not map IP addresses to a domain names. Instead, they hold the information about all the top-level domain (TLD) nameservers and point to location. TLD is a rightmost section of a domain name Root servers are the critical since they are first stop for all the DNS lookup requests.
TLD nameservers: These servers contain a data for second-level domains, such. Previously, the root server pointed to location of the TLD server. Then, TLD server needs to direct a request toward the server that contains a necessary data for website are trying to reach.
Authoritative nameserver: Authoritative servers are final destination for a DNS lookup requests. They provide a website’s IP address back to recursive DNS servers. If site has a subdomains the local DNS server will keep a sending requests to authoritative server until it finally resolves a IP address.
Step 5 – Receive IP Address:
Once ISP’s recursive DNS server obtains an IP address by sending the multiple iterative DNS queries, it finally returns it to computer. The record for this request now stays to cached on a hard drive. The browser can then fetch this IP froma cache and connect it to website’s server.When break it down like this, process of a DNS lookup seems to take a long time to complete. In fact, it takes a milliseconds, with maybe a few milliseconds more if a DNS record is not in local cache. In both cases, users are cannot tell the difference. This is basic description of how DNS works, and it should give an idea what goes on under a hood when are browse or send an email.
Conclusion:
This article has explained what Domain Name System is and how it works. It covered an essential DNS functions and what needs to be happen before can connect to an online server using a domain name.
Are you looking training with Right Jobs?
Contact Us- Hadoop Tutorial
- Hadoop Interview Questions and Answers
- How to Become a Hadoop Developer?
- Hadoop Architecture Tutorial
- What Are the Skills Needed to Learn Hadoop?
Related Articles
Popular Courses
- Hadoop Developer Training
11025 Learners
- Apache Spark With Scala Training
12022 Learners
- Apache Storm Training
11141 Learners
- What is Dimension Reduction? | Know the techniques
- Difference between Data Lake vs Data Warehouse: A Complete Guide For Beginners with Best Practices
- What is Dimension Reduction? | Know the techniques
- What does the Yield keyword do and How to use Yield in python ? [ OverView ]
- Agile Sprint Planning | Everything You Need to Know