DNS (Domain Name System)
A hierarchical distributed naming system that translates human-readable domain names (like www.example.com) into IP addresses (like 192.0.2.1) that computers use to identify and communicate with each other on networks.
Key Characteristics:
DNS functions as the internet's phone book, maintaining a directory of domain names and their corresponding IP addresses. It operates using a client-server architecture where DNS clients (resolvers) query DNS servers to resolve domain names. The system is distributed across millions of servers worldwide, making it both scalable and resilient.
How It Works:
When you type a website address into your browser, a DNS resolver queries DNS servers in a hierarchical process. It starts with root servers, then top-level domain (TLD) servers (like .com or .org), then authoritative name servers for the specific domain. The result is cached at multiple levels to improve performance for future requests.
DNS Record Types:
- A Record: Maps domain to IPv4 address
- AAAA Record: Maps domain to IPv6 address
- CNAME Record: Creates an alias for another domain
- MX Record: Specifies mail servers for the domain
- NS Record: Identifies authoritative name servers
- TXT Record: Stores text information for various purposes
Common Uses:
- Web browsing (translating URLs to IP addresses)
- Email routing (MX records direct messages)
- Service discovery
- Domain verification
- Anti-spam and security (SPF, DKIM records)
Port and Protocol:
DNS primarily uses UDP port 53 for queries, though it can use TCP for larger responses or zone transfers. This makes DNS queries fast and efficient.
Security Considerations:
DNS is vulnerable to attacks like cache poisoning and DDoS. DNSSEC (DNS Security Extensions) adds cryptographic signatures to protect against tampering and spoofing.