Forward Lookup: How DNS Finds an Address for a Name
You remember a website's name. Your computer needs an address. A forward lookup supplies that missing piece before the browser can try to connect.
A forward lookup finds the IP address associated with a name, such as example.com. IP stands for Internet Protocol; an IP address tells the network where to direct traffic. DNS, the Domain Name System, holds the records that connect readable names with those addresses.
The name being looked up is called a hostname. In https://example.com/news/, that name is example.com; the page path, /news/, isn't part of the DNS question.
A lookup can succeed even when the website it points to isn't responding. Finding the address gives the browser somewhere to try.
What Happens When You Type a Web Address?
Who Actually Finds the Answer?
An application asks a resolver, software that obtains DNS answers. A recursive resolver can query other DNS servers on the application's behalf.
It may have an answer in its cache, a temporary store of previous results. Otherwise, it can follow directions from other DNS servers to one responsible for the records: an authoritative server.
The answer comes back to the application. DNS can return several addresses for the same name. These resolver and caching roles are set out in the foundational DNS specification.
The Letters Beside a DNS Answer
DNS stores several kinds of records. Their labels tell you what information an answer contains.
| Record | What it provides |
|---|---|
| A | An address for Internet Protocol version 4 (IPv4), written with four groups of numbers separated by dots |
| AAAA | An address for Internet Protocol version 6 (IPv6), written with groups separated by colons |
| CNAME | Another name to look up: an alias pointing to its canonical, or official, name |
An A or AAAA record supplies an address directly. A CNAME supplies a name that must be resolved further to obtain an address.
- Start tonight: the board, case, power supply and memory card are all in the box.
- Run a home lab, an ad blocker or a practice server on one small computer.
- Learn Linux hands-on without risking your main machine.
The DNS record specification defines A and CNAME records. The IPv6 extension defines AAAA records, including how several records can provide several IPv6 addresses.
Email adds another step. A sending mail server looks for MX records, which name the servers responsible for receiving mail for a domain. It then looks up those servers' addresses. The email-delivery standard also defines a fallback when no MX record exists. A domain's website address alone doesn't describe this whole process.
The Whole Internet, Explained in Nine Minutes
Why Yesterday's Answer Can Still Appear
A cached DNS record has a time to live, or TTL: a limit on how long that saved answer remains usable. Changing a record at its authoritative source doesn't instantly erase copies already held in caches.
That helps explain why two lookups made around a change can produce different results. One resolver may still have an earlier answer; another may have obtained the update. Caching can explain that difference without an attack being involved.
An operating system can resolve a name from a local hosts file, a list of names and addresses stored on the computer. That's name resolution, but it isn't a DNS exchange. Microsoft's Windows troubleshooting guidance distinguishes these mechanisms; their order depends on the system and its settings.
- Turn sketchy hotel and airport Wi-Fi into your own private network in minutes.
- Put every device you own behind your VPN at once, with nothing to install on each one.
- Block ads and trackers for everything connected with the flick of a switch.
Reading a Failed Lookup
For example, on Windows, nslookup example.com asks the default DNS server about that name. Microsoft's nslookup reference explains the command and its error messages.
Two errors point to different problems. A timeout means the query didn't receive an answer within the waiting period. A nonexistent domain response says the queried name doesn't exist. Neither message means simply “the whole internet is down.”
A reverse lookup works in the other direction, asking which name is recorded for an address. It uses a separate PTR record, short for pointer record. Forward and reverse records can disagree, and a reverse result doesn't establish who's using the address.
An Address Isn't a Safety Verdict
DNSSEC, short for Domain Name System Security Extensions, uses digital signatures to check that DNS data came from the expected source and wasn't altered. These signatures are mathematical proofs attached to the records. Its security specification makes clear that DNSSEC doesn't hide the data it protects.
Nor does it judge whether a website's content is honest. Even an authenticated address answer doesn't prove that a page is safe, or that the service will work when you connect.
Networking divides these tasks among different protocol layers. If a lookup returns an address but the page still won't load, the connection and the website itself remain separate places to investigate.
How DNS Finds an Answer Without One Giant Directory

gethostbyname(): What the Name Lookup Actually Returns

Fully Qualified Domain Names: What the Whole Name Tells You

QUOTE:
"Amateurs hack systems, professionals hack people."

