Watch on Instagram

Network Bytes · Episode 72 · CCNA 4.3

"nslookup and DNS troubleshooting"

DNS turns names into addresses, and when it breaks, websites look dead even though your connection is fine. With nslookup you can ask a DNS server yourself, read which server answered and the address it found, and try a different server to see whether your usual one is the problem.

Posted · About a 1 minute watch, 3 minute read · Take the quiz

DNS is the phone book

Computers reach each other by IP address, but people type names like example.com. DNS (the Domain Name System) turns those names into addresses. When DNS breaks, every website seems dead, even though your connection, your cable and your Wi-Fi are working fine. That is what makes DNS problems confusing: the network is up, but nothing loads by name.

Look it up yourself with nslookup

nslookup works on Windows, macOS and Linux. Type nslookup followed by a name:

`` C:\> nslookup example.com Server: 192.168.1.1 Non-authoritative answer: Name: example.com Address: 203.0.113.10 ``

  • The first lines show which DNS server answered you, usually your router or the server your network gave you.
  • Below that is the answer: the name and the address it found. "Non-authoritative answer" is normal; it means the server answered from its cache or by asking other servers for you, not that something is wrong.
  • An error (such as "can't find" or "Non-existent domain") or a timeout ("DNS request timed out") means the lookup failed.

The output in the video is shortened, and 203.0.113.10 is a documentation-only example address; the real answer depends on where you are and when you ask.

Try another server

To check whether it's just your usual server, put a different DNS server's address at the end:

`` nslookup example.com 1.1.1.1 ``

Now the question goes to that server instead of your default one. If it answers while your usual server fails or times out, your usual server (or the setting that points you to it) is the problem, not your connection. 1.1.1.1 is one public DNS resolver, used here only as an example.

Try it yourself

Open Command Prompt (Windows) or Terminal (macOS, Linux) and type nslookup wikipedia.org. Note which server answered and which addresses came back. Then run nslookup wikipedia.org 1.1.1.1 and compare: is the server line different? Are the addresses the same? On Linux or macOS, try dig wikipedia.org too.

Good to know

  • nslookup (Windows, macOS, Linux) queries DNS; nslookup name server asks a specific server instead of the default one.
  • The output first lists the server used, then the answer. "Non-authoritative answer" is normal when a resolver answers from cache or via recursion, and is not an error.
  • dig is the common alternative on Linux and macOS.
  • Name lookups can also fail because of a wrong DNS server in your device's settings (see EP71, ipconfig), an entry in the hosts file, or a firewall blocking DNS on port 53.
  • 203.0.113.10 is a documentation-only address (RFC 5737) standing in for the real answer; 1.1.1.1 is a public resolver used as an example.

For CCNA learners

CCNA 200-301 topic 4.3 Explain the role of DHCP and DNS within the network: know that DNS resolves names to addresses, that a client sends its queries to the DNS server it was configured with, and how nslookup shows which server answered and what it returned.

Answer to the comment question

No. If ping 203.0.113.10 gets replies, your cable, your Wi-Fi and the whole path to that host are working. What fails is turning the name into an address, so it's DNS (name lookup) that is broken. Next step: run nslookup example.com to see which server answers, try another server with nslookup example.com 1.1.1.1, and check the DNS server in your IP settings with ipconfig /all.

Test your knowledge

Quick quiz: "nslookup and DNS troubleshooting"

4 multiple-choice questions. Pick one answer for each, then check how you did.

1What does DNS do?
2In nslookup's output, what do the first lines tell you?
3You see "Non-authoritative answer" above the address. What does it mean?
4Your usual DNS server times out, but nslookup example.com 1.1.1.1 answers. What is the likely problem?

Sources

Video transcript

How do you test whether DNS is working?

DNS is the internet's phone book. It turns names into addresses. When it breaks, websites look dead, while your connection is fine.

With nslookup, you can look in the phone book yourself. Type nslookup, then a name, like example dot com.

The first lines show which DNS server answered you. Below that is the address it found. An error or a timeout means the lookup failed.

To check if it's just your usual server, add a different DNS server's address at the end. If that one answers, your usual server is the problem.

Ping by name says it can't find the host. Ping by IP address gets replies. Is your cable the problem? Comment your answer below!

That's your byte.

More from Network Bytes

All Network Bytes lessons