How a DNS Lookup Turns a Website Name Into an Address

Diagram of a DNS lookup: browser, resolver, root server, .com TLD server and authoritative name server exchanging queries

You type knowgrasp.com and press Enter. Your browser cannot go there yet. Computers on the internet find each other by number, called an IP address, not by a name. First, the name has to be translated.

That translation is a DNS lookup. DNS stands for Domain Name System. Cloudflare’s Learning Center describes it as the phonebook of the internet: it turns a name people can remember into the address a machine can use. Mozilla’s MDN glossary says the same thing, and calls that mapping a DNS lookup.

Animated diagram of a DNS lookup: browser, resolver, root server, .com TLD server and authoritative name server exchanging queries
A short animation of a DNS lookup, from the browser to the resolver, root, TLD and authoritative servers. The address 203.0.113.10 is an example, not a real site address.

The four places a query usually visits

A full lookup, when nothing is already remembered, typically involves four kinds of server, which Cloudflare lists as:

  • A resolver, often run by your internet provider or a public service such as 1.1.1.1, which takes the question from your browser and does the hunting.
  • A root server, which does not know the final address, but can point the resolver toward the right top-level domain, such as .com.
  • A TLD server for that ending, which can name the domain’s own authoritative servers.
  • An authoritative name server for the domain, which holds the actual record, such as the A record that stores an IPv4 address.

If you have changed the DNS setting on your phone, computer or router, the resolver may be a public service. Cloudflare’s 1.1.1.1, Google Public DNS at 8.8.8.8 and Quad9 at 9.9.9.9 are three widely used examples. You do not have to switch to any of them for a lookup to work; many people simply use the resolver their internet provider assigns.

Eight steps, usually in milliseconds

Cloudflare walks through eight steps when nothing is cached. They match the path in the animation that accompanies this article:

  1. Your browser asks the resolver for knowgrasp.com.
  2. The resolver asks a root server where .com lives.
  3. The root points the resolver to the .com TLD servers.
  4. The resolver asks a .com TLD server about knowgrasp.com.
  5. The TLD names the domain’s authoritative server.
  6. The resolver asks that authoritative server for the A record.
  7. The authoritative server returns the IP address.
  8. The resolver caches the answer and sends it back to the browser.

In the animation, that address is shown as 203.0.113.10, and the authoritative server as NS1.KNOWGRASP. Both are examples. 203.0.113.10 belongs to a documentation range, 203.0.113.0/24, set aside in RFC 5737, so tutorials can show a realistic-looking IPv4 address without pointing at a real machine. It is not the address of knowgrasp.com.

Once the browser has a real address, it can open a connection and request the page. The whole exchange often takes only milliseconds.

The record types you will see most often

The answer to a lookup is stored as a DNS record. Cloudflare’s reference list of DNS record types and the older DNS specifications describe many kinds. These are the ones you are most likely to meet:

TypeWhat it holdsTypical use
AAn IPv4 address for a nameThe usual “where is this website?” answer on today’s IPv4 internet
AAAAAn IPv6 address for a nameThe same job as an A record, for IPv6
CNAMEAnother name, not an addressAn alias, so www.example.com can point at example.com
MXThe mail servers for a domainTells other systems where to deliver email
NSThe authoritative name servers for a domain or zonePoints resolvers at the servers that hold the real records
TXTA piece of textOften used to verify a domain, or to publish email authentication records
SOAAdministrative details for the zoneMarks the start of a zone and holds timing and contact data
PTRA name for an IP addressThe reverse of an A or AAAA lookup: “what name belongs to this number?”

How to look up a name yourself

You can ask a resolver the same kind of question your browser asks, from a terminal. On macOS, Windows or Linux, either of these is a starting point:

dig knowgrasp.com
nslookup knowgrasp.com

Those commands use whatever resolver your system is already configured to query. Add a record type if you want a specific answer, for example dig knowgrasp.com MX or nslookup -type=MX knowgrasp.com. The output is a technical listing, not a security scan: a result only tells you what that resolver returned at that moment.

Why a second visit is usually quicker

Most lookups never walk all eight steps. Answers are cached in the browser, in your operating system, and at the resolver, each for a limited time set by a TTL, or time to live. If the resolver already knows the .com servers, or already has the A record, it skips the earlier questions. That is why a site you opened five minutes ago can appear almost instantly the second time, and why a change to a domain’s address can take a while to show up everywhere.

The next time a page “can’t be found,” or a site name will not resolve, you will know what failed: not the page itself, but the lookup that was supposed to find it. After the address arrives, a different short conversation takes over, the TCP handshake that actually opens the connection.

Common questions

Why does the animation show 203.0.113.10?

It is a reserved example address from RFC 5737’s documentation range, 203.0.113.0/24. Tutorials use it so they are not pointing at someone’s real machine. It is not knowgrasp.com’s address, and NS1.KNOWGRASP is also a made-up label for the diagram.

Do I need a special DNS service for this to work?

No. Your internet provider’s resolver is enough for an ordinary lookup. Public resolvers such as 1.1.1.1, 8.8.8.8 and 9.9.9.9 are optional alternatives, each with its own privacy and security policy.

Why is a site I just changed still showing the old address?

Because of caching. The old answer can sit in a resolver or on your device until its time to live expires. That delay is normal, not a sign that the change failed.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *