1. What is DNS?
DNS (Domain Name System) is the “phone book” of the Internet. Its core function is to translate human-readable domain names (e.g. ‘google.com’) into computer-recognizable IP addresses (e.g. ‘142.250.190.46’). Without DNS, we would have to memorize a string of numbers in order to access websites, and DNS makes the Internet much more user-friendly and efficient.
The core functions of DNS
- Domain name resolution: converts ‘example.com’ to ‘93.184.216.34’ (IPv4) or ‘2606:2800:220:1:248:1893:25c8:1946’ (IPv6).
- Load Balancing: Improves website stability by distributing access requests to different servers through DNS polling.
- Mail Routing: Ensures that emails are correctly sent to the target server (MX records).
- Security Protection: Prevent DNS hijacking and spoofing attacks by combining DNSSEC (DNS Security Extension).
2. DNS Resolution Process
When you enter a URL into your browser, the DNS resolution process is as follows. 1:
1. Browser cache → check whether the website has been visited recently (if the cache has not expired, it will be used directly). 2.
2. Operating System Cache → Check the local Hosts file and system DNS cache. 3.
3. Router/ISP DNS Cache → If there is no local record, query the DNS server of ISP (e.g. Telecom, Unicom). 4.
4. Recursive Query → If the ISP does not have a cache, the DNS server will start from the root domain name server (.) → the top level domain name server (.). → top-level domain name servers (.com) → authoritative domain name servers (google.com) level by level. 5.
5. Return resolution results → the final IP is returned to the user and cached to the local and ISP DNS. 3.
3. DNS Cache Time (TTL)
The caching time of a DNS record is determined by TTL (Time-To-Live) in seconds.
(1) Who controls the TTL?
- The domain name administrator (e.g. webmaster) sets the TTL value in the DNS resolution service provider (e.g. Cloudflare, Aliyun DNS).
- Common TTL values:
- ‘60’ (1 minute) → For IPs that change frequently (e.g. CDN, load balancing).
- ‘300’ (5 minutes) → Commonly used for dynamically adjusted services.
- ‘3600’ (1 hour) → Default for most websites.
- ‘86400’ (24 hours) → For long-term stable services.
(2) Different levels of DNS caching time
| Cache Location | Cache Time | How to force refresh? | Cache Location | Cache Time | How to force a refresh?
|-|-|-|-|
| Browser Cache | Usually 1-60 minutes | ‘Ctrl + F5’(force refresh) |
| OS Cache | Follows TTL, but may be modified | ‘ipconfig /flushdns’ (Windows) |
| Router Cache | May ignore TTL and cache longer | Reboot router or wait for expiration |
| ISP DNS Cache | Sometimes extends cache (causing delayed DNS updates) | Change DNS (e.g., change to 1.1.1.1 or 8.8.8.8) |
4. How to view/clear DNS cache?
(1) Windows
'''bash
View DNS cache
ipconfig /displaydns
Flush DNS Cache
ipconfig /flushdns
'''
Domaincn.com Committed to providing fair and transparent reports. This article aims to provide accurate and timely information, but should not be construed as financial or investment advice. Due to the rapidly changing market conditions, we recommend that you verify the information yourself and consult a professional before making any decisions based on this information.