When we enter a website address in a browser, the computer needs to find out where to send the request. This is where DNS — the Domain Name System. It connects readable names, such as example.com, to resource records, which can include IP addresses.
What happens during a DNS lookup
- The browser or operating system checks its available local cache.
- If there is no cached answer, a query is sent to a recursive DNS resolver.
- When needed, the resolver follows the DNS hierarchy and obtains an answer from the authoritative nameservers.
- The answer is returned to the client and may be cached for the period specified by its TTL.
Common DNS record types
- A — an IPv4 address for a name.
- AAAA — an IPv6 address.
- CNAME — an alias pointing to another domain name.
- MX — mail exchangers for a domain.
- TXT — text data, including SPF policies and ownership verification.
Why TTL matters
TTL (time to live) tells resolvers how long an answer can remain cached. A low TTL can make infrastructure changes easier, but increases DNS lookup frequency. A high TTL reduces repeat queries, but old answers may persist for longer.
How to inspect a record
On Linux and macOS, you can use dig. This command returns the A records for a given name:
dig +short A example.comA proper check considers not just the addresses, but also the authoritative nameservers and the possibility of stale cached records.
Takeaway
DNS is one of the first steps in almost every web request. Careful zone management, record verification, and a good understanding of TTL help prevent problems during migrations and infrastructure changes.