DNS (Domain Name System) dịch domain name (google.com) thành IP address. Quá trình resolve:
- Browser kiểm tra local cache
- Hỏi OS resolver (kiểm tra /etc/hosts)
- Hỏi Recursive Resolver của ISP
- Resolver hỏi Root Name Server (biết địa chỉ TLD servers)
- Hỏi TLD Name Server (.com, .vn)
- Hỏi Authoritative Name Server của domain (trả về IP cuối cùng). Kết quả được cache theo TTL (Time To Live)
Có nhiều record type: A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail), TXT (SPF/DKIM), NS (name server). Thực tế lập trình: DNS propagation khi thay đổi record có thể mất vài giờ đến 48h tùy TTL. Dùng dig, nslookup để debug; DNS-over-HTTPS (DoH) và DNS-over-TLS (DoT) mã hóa DNS queries để tăng privacy.
DNS (Domain Name System) translates domain names (e.g., google.com) into IP addresses. The resolution process:
- the browser checks its local cache
- queries the OS resolver (checks /etc/hosts)
- queries the ISP's recursive resolver
- the resolver queries a root name server (which knows TLD server addresses)
- queries the TLD name server (.com, .vn)
- queries the authoritative name server for the domain, which returns the final IP. Results are cached according to their TTL (Time To Live)
Common record types include: A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail), TXT (SPF/DKIM), NS (name server). In practice: DNS propagation after a record change can take minutes to 48 hours depending on TTL. Use dig or nslookup for debugging; DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) encrypt DNS queries for improved privacy.