Domain Name System (DNS)

What is DNS?

Why DNS Required?

How does DNS works?

When you type a URL into a browser, the DNS finds the corresponding IP address and connects you to the website.

DNS
Steps in DNS Resolution
dns-hierarchy
Types of DNS Servers:
  1. Recursive Resolver:
  2. Root DNS Server:
  3. TLD (Top-Level Domain) Server:
  4. Authoritative Name Server:

Types of DNS Records:

DNS Protocols:
  1. UDP: Most DNS queries use UDP for speed. The message size is usually 512 bytes or less.
  2. TCP: Used for larger queries or zone transfers.
  3. DNS over HTTPS (DoH) and DNS over TLS (DoT): Encrypt DNS queries for improved privacy and security.

How to check DNS in Browser and Local OS
How to Check DNS Cache in Browsers?

Type the following in the address bar and press Enter:


How to Check Local DNS Cache?

Here are the commands for different operating systems to view or clear the DNS cache:


List of global DNS providers:

Interview Questions and Answers
Q1: How does DNS caching work, and how can it impact the resolution process in both positive and negative ways?

DNS caching involves storing DNS query results temporarily on various levels (browser, OS, ISP, etc.) to speed up subsequent requests for the same domain. Caching reduces latency, decreases the load on DNS servers, and improves the overall user experience.

Q2: How would you troubleshoot a situation where a user can access a website via IP address but not through its domain name?

Q3: Explain how DNS load balancing works and describe a scenario where it might fail to distribute traffic evenly.