The internet is a huge network of computers. Each device connected to the Internet has a unique IP address that other machines use to find the device on the internet.
This IP address is a string of numbers with periods that looks like this: 192.168.10.23
Now imagine if you had to remember such long strings of numbers to visit your favorite websites. They are hard to remember and don’t tell you anything about the website you’ll see if you enter them in a browser.
To solve this problem, a Domain Name System was invented that allows users to select easy-to-remember names for their websites instead of a long string of numbers.
DNS or Domain Name System basically translates those domain names into IP addresses and points your query in the right direction.
Let’s see in more detail.
Table of Contents
What is DNS?
The Domain Name System (DNS) is like a phonebook of the Internet. Humans access information online through domain names, like facebook.com or bishnubaliyase.com. When a user enters a domain name like bishnubaliyase.com on their browser, it looks up for the IP address of bishnubaliyase.com. DNS translates this human-readable domain name (bishnubaliyase.com) to a machine-readable IP address (103.53.40.64) so that browsers can connect to the server where the website (https://crackdeal.in) is stored.
How Does DNS Work?
When a user types a human-readable address (URL) into the browser, the operating system’s DNS client will check for information in a local cache. If the requested address isn’t there, it will look for a Domain Name System server in the local area network (LAN). When the local ISP DNS server receives the query, and the requested domain name is found, it will return the result.
Since these DNS server’s cache contains a temporary store of DNS records, it will quickly respond to requests. These DNS cache servers are called non-authoritative DNS servers as they provide request resolution based on a cached value.
If records not cached in the local ISP DNS server (also called DNS recursive resolver) it forwards the query to the Root Name Server that maintains and provides a list of name servers for each of the top-level domains (.com, .org, .net, etc.).
These Top Level Domain Name Server maintains and provides a list of authoritative name servers for all domains (facebook.com, wikipedia.org, etc.). Its job is to query name servers to find and return the authoritative name server for the requested domain.
Now authoritative name server returns the IP address of the URL requested initially.
What Are The Steps In A DNS Lookup?
Step#1– A user types ‘bishnubaliyase.com’ into a web browser and the query travels into the Internet and is received by a DNS recursive resolver. This may be a local DNS server or Internet Service Provider’s (ISP) DNS or Google Public DNS (8.8.8.8)
Step#2– The resolver then forwards the queries to a Root nameserver (.).
Step#3– The root server then responds to the resolver with the address of a Top-Level Domain (TLD) DNS server (such as .com), which stores the information for its domains. When searching for bishnubaliyase.com, our request is pointed towards the .com TLD.
Step#4– The resolver then makes a request to the .com TLD name server.
Step#5– The TLD name server then responds with the IP address of the domain’s nameserver, also called the authoritative DNS server, where the IP address of bishnubaliyase.com can be found.
Step#6– The recursive resolver sends a query to the authoritative nameserver. Generally, authoritative nameservers are managed by the domain name registrar or hosting provider company.
There could be more than one authoritative DNS server with the hosting company configured as primary and secondary nameserver to provide load sharing and redundancy.
Step#7– The IP address for bishnubaliyase.com.com is then returned to the resolver from the nameserver.
Step#8 and Step#9 are used only when the authoritative server 2 is either busy or not available. So that authoritative server 1 can answer the query.
Step#10– The DNS resolver then responds to the browser with the IP address of the domain (bishnubaliyase.com) requested initially.
Step#11– Now the browser makes an HTTP request to the IP address and the server at that IP returns the webpage of bishnubaliyase.com.
Types Of DNS Server
- DNS Resolver – The DNS recursive resolver can be thought of as a librarian who is asked to go find a particular book somewhere in a library. The recursive DNS resolver is a server designed to receive queries from client machines through applications such as web browsers. Typically the recursive resolver is then responsible for making additional requests in order to satisfy the client’s DNS query. If a recursive DNS has the DNS reference cached or stored for a period of time, then it answers the DNS query by providing the source or IP information. If not, it passes the query to root DNS servers to find the information.
- Root nameserver – The root server(.) is the first step in translating (resolving) human-readable hostnames into IP addresses. It can be thought of like an index in a library that points to different racks of books – typically it serves as a reference to other more specific locations.
- TLD nameserver – The top-level domain server (TLD) can be thought of as a specific rack of books in a library. This nameserver is the next step in the search for a specific IP address, and it hosts the last portion of a hostname (In bishnubaliyase.com, the TLD server is “.com”, and in example.net. the TLD server would be “.net”).
- Authoritative nameserver – This final nameserver can be thought of as a dictionary on a rack of books, in which a specific name can be translated into its definition. The authoritative nameserver is the last stop in the nameserver query. If the authoritative name server has access to the requested record, it will return the IP address for the requested hostname back to the DNS Recursor (the librarian) that made the initial request.
What Is A Name Server?
A name server, sometimes spelled “nameserver”, is a special type of server that keeps all the DNS records of your domain name. Its job is to provide your DNS information to anyone requesting it.
Nameservers are typically managed by your domain name registrar or hosting provider.
Each nameserver has its own address and can store the records of many websites. For example, if your website is hosted on Bluehost then the name server used to manage your DNS records will be on nameservers with addresses that look like this:
NS1.bluehost.com
NS2.bluehost.com
Each domain name must have at least two nameservers. The first nameserver is the primary server. If the primary server does not respond, then the secondary nameserver is used to resolve the domain name.
What Is DNS Caching?
The purpose of caching is to temporarily store data in a location that results in improving performance and reliability for data requests. DNS caching involves storing data closer to the requesting client so that the DNS query can be resolved faster and additional queries further can be avoided, thereby improving the load times of the requested website.
DNS data can be cached in a variety of locations.
Browser Of Your System
Modern web browsers are designed by default to cache DNS records for a set amount of time. When a request is made for a DNS record, the browser cache is the first location checked for the requested record. This speedup the website loading.
In Chrome, you can see the status of your DNS cache by typing in the URL- chrome://net-internals/#dns.
Operating System Of Your Machine
The operating system of your laptop /desktop also caches the DNS records for a specified time (called TTL or time to leave). When the requested DNS records not found in the browser, it checks with the operative system of your machine, before leaving to the local DNS server.
Local /ISP DNS Resolver
When the recursive DNS resolver of ISP receives a DNS query, it will also check to see if the requested host-to-IP-address translation is already stored inside its cache. If it is found, it answers the query and thus avoids further DNS lookup chain till authoritative DNS servers.
DNS Record Types
The most common DNS record types are:
- Address Mapping record (A Record)—also known as a DNS host record, stores a hostname and its corresponding IPv4 address.
- IP Version 6 Address record (AAAA Record)—stores a hostname and its corresponding IPv6 address.
- Canonical Name record (CNAME Record)—can be used to alias a hostname to another hostname. When a DNS client requests a record that contains a CNAME, which points to another hostname, the DNS resolution process is repeated with the new hostname.
- Mail exchanger record (MX Record)—specifies an SMTP email server for the domain, used to route outgoing emails to an email server.
- Name Server records (NS Record)—specifies that a DNS Zone, such as “example.com” is delegated to a specific Authoritative Name Server, and provides the address of the name server.
- Reverse-lookup Pointer records (PTR Record)—allows a DNS resolver to provide an IP address and receive a hostname (reverse DNS lookup).
- Service Location (SRV Record)—a service location record, like MX but for other communication protocols.
- Text Record (TXT Record)—typically carries machine-readable data such as opportunistic encryption, sender policy framework, DKIM, DMARC, etc.
- Start of Authority (SOA Record)—this record appears at the beginning of a DNS zone file, and indicates the Authoritative Name Server for the current DNS zone, contact details for the domain administrator, domain serial number, and information on how frequently DNS information for this zone should be refreshed.
Related Articles