Home › The Stash

DNS Explained: How a Name Becomes an Address (with nslookup)

LabOctober 12, 2026

BeginnerIdea buildTime ~25 minTool nslookupOS Windows (works on Mac too)Needs nothingCost freeExam N+ 1 · Sec+ 2

0 / 6 steps

The goal

By the end you will have looked up the address behind a website name yourself, asked for different kinds of DNS records, seen caching at work, asked a different DNS server the same question, and learned what the official DNS standards actually define.

Words in this lesson

Hover (or tap and hold) a dotted word for a quick definition. Every word is also in the StashGrid glossary.

  • DNS — the internet’s phone book
  • IP address — the number address computers really use
  • Resolver — the helper that looks names up for you
  • nslookup — a tool that asks DNS a question
  • Record types — the different kinds of DNS answer
  • TTL — how long an answer may be remembered
  • RFC — the official instruction manual for an internet technology

Why this lesson. When someone says “the internet is down,” very often it is actually DNS: the connection works, but names are not turning into addresses. Knowing how to ask DNS directly tells you in ten seconds which one is broken.

It is always DNS. When it is not DNS, it is DNS pretending not to be. That is an old network joke, and the funny part is how often it is true. — Nyx

Before you start. You need a command prompt (Windows) or Terminal (Mac). nslookup works the same on both. It will help to know what an IP address is.

Steps

01What DNS does, in plain words

Computers find each other by number (an IP addressIn plain words: A device’s street address on a network: four numbers separated by dots, like 192.168.1.37.Technical: A 32-bit number (IPv4), written as four octets. It combines which network the device is on and which device it is on that network.Click for the full glossary entry), but people remember names. DNSIn plain words: The internet’s phone book. You type an easy name like stashgrid.ai, and DNS looks up the number address that computers really use, the way a street address tells the mail carrier where to go.Technical: Domain Name System. A worldwide set of servers that turns names into IP addresses. Your device asks a DNS server (usually your router or your provider) every time you visit a site.Click for the full glossary entry is the phone book that turns a name like stashgrid.ai into a number. It is also a bitIn plain words: A bit is one on-or-off switch. Eight of them make a byte.Technical: The smallest unit of data: 0 or 1. An IPv4 address is 32 bits, grouped as four 8-bit octets.Click for the full glossary entry like a street address: the name is what you tell people, and the number is what the mail carrier needs.

Here is the journey of one lookup:

  1. Your computer checks its own memory first. If it recently looked up the name, it already knows.
  2. If not, it asks a resolverIn plain words: The helper that looks up names for you, like a receptionist who knows who to ask. Your router or internet provider normally runs it.Technical: A server that answers DNS questions for clients, asking other DNS servers if it does not already know and remembering answers for a while (caching).Click for the full glossary entry (usually your routerIn plain words: The box that connects your home to the internet and passes data between networks.Technical: Forwards packets between networks. At home it is usually also the Wi-Fi access point and the DHCP server.Click for the full glossary entry, which passes it to your internet provider’s DNS, or to a public one like 1.1.1.1 or 8.8.8.8).
  3. If the resolver does not know, it asks a root server: “who handles .ai?”
  4. Then it asks the .ai servers: “who handles stashgrid.ai?”
  5. Then it asks that domainIn plain words: The easy-to-read name of a website or email sender, like example.com. In an email from sam@example.com, the domain is the part after the @.Technical: A name registered in the global naming system, made of labels separated by dots, and resolved to addresses by DNS.Click for the full glossary entry’s own authoritative server: “what is the address?” and gets the final answer.
  6. The answer is passed back to you, and remembered for a while so the next lookup is instant.

Why this matters. Almost everything you do online starts with a DNS lookup. If it fails, nothing loads, even though the connection itself is fine.

02Ask DNS a question with nslookup

Open a command promptIn plain words: A window where you type instructions instead of clicking. The shortcut name is cmd.Technical: Windows’ text-mode shell (cmd.exe). PowerShell is a newer one. On a Mac the equivalent is Terminal.Click for the full glossary entry and type:

> nslookup stashgrid.ai

Read the answer in two parts:

If you see several addresses, the site uses more than one server for the same name. That is normal for busy sites.

Why this matters. This is how you prove a name points where you think it does. It is the first thing to check when a site is “down for you but up for everyone else.”

03Ask for different kinds of records

DNSIn plain words: The internet’s phone book. You type an easy name like stashgrid.ai, and DNS looks up the number address that computers really use, the way a street address tells the mail carrier where to go.Technical: Domain Name System. A worldwide set of servers that turns names into IP addresses. Your device asks a DNS server (usually your router or your provider) every time you visit a site.Click for the full glossary entry stores more than addresses. Each kind of answer is a record type. Try these:

> nslookup -type=A example.com
> nslookup -type=AAAA example.com
> nslookup -type=NS example.com
> nslookup -type=MX gmail.com
> nslookup -type=TXT gmail.com

Why this matters. Email that does not arrive is usually an MX problem. Websites that do not load after a move are usually an A or CNAME problem. Knowing the record typesIn plain words: The different kinds of answer DNS can give: an address, a mail server, who is in charge, or a note.Technical: A maps a name to an IPv4 address, AAAA to an IPv6 address, CNAME to another name, MX to mail servers, NS to the zone’s name servers, TXT to free text such as SPF policies.Click for the full glossary entry tells you where to look.

04See caching and flush your DNS memory

Your computer remembers answers so the next lookup is instant. Each answer comes with its own TTLIn plain words: A countdown stamped on every packet so it cannot wander the internet forever.Technical: A counter that drops by one at every router. At zero the router discards the packet and replies with an ICMP time-exceeded message. Traceroute uses this to make each router identify itself. (DNS records have a different TTL: how long an answer may be remembered.)Click for the full glossary entry, the number of seconds it may be remembered. (This is a different TTL from the one traceroute uses, and the names are a coincidence.)

To see what your computer currently remembers, and then forget it:

> ipconfig /displaydns
> ipconfig /flushdns

The first prints a long list of remembered names. The second clears it, and Windows says it succeeded. Your next lookups are slower for a moment as DNSIn plain words: The internet’s phone book. You type an easy name like stashgrid.ai, and DNS looks up the number address that computers really use, the way a street address tells the mail carrier where to go.Technical: Domain Name System. A worldwide set of servers that turns names into IP addresses. Your device asks a DNS server (usually your router or your provider) every time you visit a site.Click for the full glossary entry is asked again.

Why this matters. When a site moves and you still reach the old one, or a fixed record does not take effect, stale memory is why. Flushing is the fix on your side. The TTL tells you how long everyone else may take to catch up.

05Is it the internet or just DNS?

Try these two, one after the other:

> ping 1.1.1.1
> ping example.com

You can ask a specific resolver by adding its address at the end:

> nslookup stashgrid.ai 1.1.1.1
> nslookup stashgrid.ai 8.8.8.8

1.1.1.1 is Cloudflare’s public resolver and 8.8.8.8 is Google’s. If they answer but your own resolver does not, your routerIn plain words: The box that connects your home to the internet and passes data between networks.Technical: Forwards packets between networks. At home it is usually also the Wi-Fi access point and the DHCP server.Click for the full glossary entry or provider’s DNS is the problem, and you can set your computer or router to use a public one instead.

Why this matters. This two-line test saves hours. It separates “no connection” from “no names” immediately.

06What the official standards define

DNSIn plain words: The internet’s phone book. You type an easy name like stashgrid.ai, and DNS looks up the number address that computers really use, the way a street address tells the mail carrier where to go.Technical: Domain Name System. A worldwide set of servers that turns names into IP addresses. Your device asks a DNS server (usually your router or your provider) every time you visit a site.Click for the full glossary entry was written down in 1987 in two documents that are still the foundation: RFC 1034 (concepts and facilities) explains the ideas (the tree of names, zones, resolversIn plain words: The helper that looks up names for you, like a receptionist who knows who to ask. Your router or internet provider normally runs it.Technical: A server that answers DNS questions for clients, asking other DNS servers if it does not already know and remembering answers for a while (caching).Click for the full glossary entry), and RFC 1035 (implementation and specification) defines the exact message format and record typesIn plain words: The different kinds of answer DNS can give: an address, a mail server, who is in charge, or a note.Technical: A maps a name to an IPv4 address, AAAA to an IPv6 address, CNAME to another name, MX to mail servers, NS to the zone’s name servers, TXT to free text such as SPF policies.Click for the full glossary entry.

The attacker’s view. Whoever controls your DNS answers controls where you go: a fake answer can send you to a fake site. That is DNS spoofing, and it is why DNS security matters.

What you learned

  • DNS — turns names into addresses, using a chain of servers and a lot of remembering
  • nslookup name — ask DNS and see who answered
  • record types — A and AAAA addresses, CNAME alias, NS in charge, MX mail, TXT notes
  • ipconfig /flushdns — forget remembered answers
  • ping 1.1.1.1 then ping a name — splits no-connection from no-DNS
  • port 53 — UDP for quick answers, TCP for big ones; plain DNS is not encrypted

Read the official spec

These are the documents the engineers wrote. They are free and dense, so use them as a reference, not bedtime reading.

Tried it? Tell us

Nova drafted this lesson from Steven’s ideas. If a step broke, looked different on your screen, or you know a simpler way, tell us. Screens change between Windows and Mac versions, so your menus may not match exactly.

NextDNSSEC Explained: What It Fixes and What It Does Not→

Go deeper

Original walkthrough. The commands are standard Windows nslookupIn plain words: A tool that asks DNS “what is the address for this name?” and shows you the answer.Technical: A command-line DNS query tool built into Windows (and available on Mac and Linux). Can request specific record types and choose which server to ask.Click for the full glossary entry and ipconfigIn plain words: Shows your computer’s network settings, including its address.Technical: A Windows command that displays IP configuration; /all adds details like DHCP server and lease times, /release and /renew control the DHCP lease.Click for the full glossary entry; the RFCIn plain words: The official instruction manual for an internet technology, written and published by the engineers who designed it. Free for anyone to read.Technical: Numbered documents from the IETF and RFC Editor that define internet standards. Examples: RFC 1035 (DNS), RFC 2131 (DHCP), RFC 8200 (IPv6).Click for the full glossary entry numbers and the ports are from the standards themselves. The sample answers are described rather than captured, and the steps have not yet been run by a person on every Windows version. If something does not match what your computer does, tell me and I will fix it.