-
Notifications
You must be signed in to change notification settings - Fork 0
DNS Server
Domain Name System is a decentralized server that translates the domain names (www.example.com) to their specific ip-address (93.184.216.34) and vice versa. It essentially acts as the internet's address book, allowing users to access websites and other online resources using human-readable domain names.
DNS Resolution Process:
- When a DHCP client needs to resolve a domain name to an IP address (e.g., when accessing a website or connecting to another device on the network), it sends a DNS query to the configured internal DNS server.
- The internal DNS server receives the DNS query and checks its authoritative DNS zones to see if it has a matching resource record for the requested domain name.
- If the internal DNS server finds a matching resource record in its zones, it returns the corresponding IP address to the client. The client then uses the returned IP address to establish the desired network connection.
+-------------------+ +-------------------+ +-----------------------+
| DNS Resolver | | ISP DNS Server | | Root DNS Server |
+-------------------+ +-------------------+ +-----------------------+
| | |
| DNS Query (example.com) | |
|------------------------------> | |
| | |
| Forward the Query | |
|------------------------------> | |
| | |
| If no Record Found | |
| (Cache Miss) | |
| ----------------------->| |
| | Hop the query to |
| | Root DNS |
| |--------------------------------> |
| | |
| | Authoritative | +--------------------------+
| | Nameserver Lookup (TLD) | | .com TLD DNS |
| |<-------------------------------- | | Server |
| | _ +--------------------------+
| | |
| | |
| | Query to (.com) TLD |
| |----------------------------------------------------------------> |
| | |
| | |
| | Authoritative Nameserver response |
| | <----------------------------------------------------------------|
| | _
| |
| | +-------------------------+
| | | Authoritative |
| | | Nameserver |
| | +-------------------------+
| | |
| | |
| | Forwarded Query |
| |----------------------------------> |
| | |
| | |
| | IP address |
| | (record A) response |
| | <----------------------------------|
| | _
| |
| Forwarded Response |
| <------------------------------|
| _
Step 1: DNS Query Initiation:
The DNS resolver (client) sends a DNS query to the ISP DNS server, requesting the IP address associated with a particular domain name.
Step 2: Recursive Resolution:
- If the DNS server receiving the query is not authoritative for the requested domain, it either resolves the query from its cache or forwards the query to the root DNS server.
- There are 13 authoritative root servers around the world that serve as the DNS root zone.
- The ISP's DNS server queries one of the root DNS servers to find the authoritative nameservers for the (.com)top-level domain.
Step 3: Authoritative DNS Lookup:
- The root DNS server responds with the authoritative nameservers for the appropriate TLD.
- The ISP's DNS server then queries one of the TLD DNS servers for the authoritative nameservers of the domain.
- The authoritative DNS Nameserver of the .com domain receives the query and looks up the corresponding IP address in its DNS records.
Step 4: Response Transmission:
The authoritative DNS Nameserver sends the IP address back to the ISP's DNS, which is then forwarded to the client.
A (Address) Record: Maps a domain name to an IPv4 address.
AAAA (IPv6 Address) Record: Maps a domain name to an IPv6 address.
CNAME (Canonical Name) Record: Alias of one domain name to another. It's often used for subdomains or when a domain needs to point to another domain.
MX (Mail Exchange) Record: Specifies the mail servers responsible for receiving email for the domain.
NS (Name Server) Record: Identifies the authoritative DNS servers for the domain.
PTR (Pointer) Record: Maps an IP address to a domain name (reverse DNS lookup).
TXT (Text) Record: Stores arbitrary text data. Commonly used for various purposes like SPF (Sender Policy Framework) records for email authentication.
SOA (Start of Authority) Record: Provides authoritative information about a DNS zone, including the primary authoritative DNS server, contact email address, zone serial number, etc.
Authoritative zones are hosted by DNS servers configured as primary (master) servers for those zones. These servers store the zone's data in zone files or database files and respond to DNS queries for domain names within the authoritative zone.