What is DNS?
DNS (Domain Name System) is a system that translates human-readable domain names (e.g., example.com) into IP addresses (e.g., 93.184.216.34) that computers can understand. It is often called the “phone book” of the internet.
Why is it needed: IP addresses are difficult-to-remember strings of numbers. Thanks to DNS, we can access websites using memorable domain names.
The Name Resolution Process
When you access “example.com” in your browser, the IP address is resolved through the following steps:
1. Check Local Cache
First, the browser and OS DNS cache are checked. If the domain was accessed previously, resolution is complete here.
# Check cache on Windows
ipconfig /displaydns
# Clear cache on macOS/Linux
sudo dscacheutil -flushcache
2. Query the Resolver
If not in cache, a query is sent to a DNS resolver (typically your ISP or Google DNS 8.8.8.8).
3. Recursive Query
The resolver queries DNS servers in the following order:
- Root DNS Server: Gets information about the top-level domain (.com)
- TLD Server: Queries the server managing .com domains
- Authoritative DNS Server: Gets the actual IP address for example.com
Types of DNS Records
- A Record: Maps domain name to IPv4 address
- AAAA Record: Maps domain name to IPv6 address
- CNAME Record: Aliases a domain name to another domain name
- MX Record: Specifies mail server
- TXT Record: Text information (SPF, DKIM, etc.)
TTL (Time To Live)
TTL specifies the time (in seconds) that a DNS record is cached:
- Long TTL (e.g., 86400 seconds = 24 hours) → Better cache efficiency
- Short TTL (e.g., 300 seconds = 5 minutes) → Changes propagate faster
Practical tip: When migrating servers, it’s common to shorten the TTL beforehand and restore it after migration.
Summary
DNS efficiently converts domain names to IP addresses using caching and hierarchical structure. For website operators, managing DNS records and setting appropriate TTL values are important skills.
← Back to list