DNS explained: from names to addresses

From a browser address bar to an IP address: a clear guide to DNS lookups, records, and TTL.

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

  1. The browser or operating system checks its available local cache.
  2. If there is no cached answer, a query is sent to a recursive DNS resolver.
  3. When needed, the resolver follows the DNS hierarchy and obtains an answer from the authoritative nameservers.
  4. The answer is returned to the client and may be cached for the period specified by its TTL.
Key principle: DNS resolves records; it does not encrypt the contents of an HTTPS connection. These are different layers of infrastructure.

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.com

A 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.

← Back to all insights