0Pricing
Network+ Academy · Lesson

Querying DNS With Nslookup

Look up records and diagnose name-resolution problems.

Querying DNS With Nslookup is a free Network+ Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Network+ Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Nslookup Does

nslookup (name server lookup) queries DNS directly, letting you ask "what IP does this name resolve to?" and inspect DNS records. While ping by name tests DNS indirectly, nslookup tests it on purpose and in detail. It is the primary command-line tool for diagnosing name-resolution problems, available on Windows, Linux, and macOS.

nslookup example.com

Why Query DNS Directly

Many outages are really DNS problems in disguise: a site "down" that is actually unresolvable, or one that points to the wrong server. Querying DNS directly with nslookup separates name resolution from connectivity. If nslookup returns the right IP, DNS is fine and you look elsewhere; if it fails, you have found the cause.

Reading the Output

A basic nslookup shows the Server that answered (your DNS server), then the queried Name and its resolved Address(es). Seeing both the server and the answer tells you who responded and what they said, the two facts you need to judge whether resolution is working correctly.

Authoritative vs Non-Authoritative

nslookup often labels an answer Non-authoritative, meaning it came from a cache or recursive resolver rather than the domain's own server. An authoritative answer comes straight from the server responsible for that domain. The distinction matters when chasing stale records: cached answers can be outdated, so going authoritative reveals the true current value.

Looking Up Record Types

You can request specific record types. Set the type to A for IPv4, AAAA for IPv6, MX for mail servers, CNAME for aliases, NS for name servers, or TXT for text records. Querying the right type lets you verify exactly the piece of DNS you suspect, such as why email is not flowing.

nslookup -type=MX example.com

Choosing a Different Server

nslookup lets you query a specific DNS server instead of your default. This is powerful: if your local server gives a stale or wrong answer, ask a public resolver like 8.8.8.8 directly and compare. A mismatch points to a problem with your DNS server or its cache rather than with the domain itself.

nslookup example.com 8.8.8.8

Reverse Lookups

A reverse lookup goes the other way, turning an IP address back into a name using PTR records. Just give nslookup an IP instead of a name. Reverse lookups confirm that an address maps back correctly, which matters for mail servers and logging where name-to-IP and IP-to-name should agree.

nslookup 8.8.8.8

Interactive Mode

Run nslookup with no arguments to enter interactive mode, where you can set options like the server or record type and run several queries in a row. This is handy when investigating a tricky DNS problem from multiple angles without retyping the full command each time. Type exit to leave.

Common DNS Symptoms

nslookup helps diagnose classic symptoms: a name that fails to resolve at all (wrong or unreachable DNS server), a name that resolves to the wrong IP (stale or bad record), and slow resolution (an overloaded or distant server). Matching the symptom to the nslookup result quickly tells you whether DNS is the villain.

Nslookup vs Dig

On Linux and macOS, dig (Domain Information Groper) is a more detailed alternative to nslookup, showing full query and answer sections and timing. Many professionals prefer dig for its clarity. CompTIA focuses on nslookup, but knowing dig exists and does the same core job makes you more capable in the field.

dig example.com

Nslookup in Troubleshooting

Reach for nslookup whenever a name-based service misbehaves but raw connectivity (ping by IP) is fine. By confirming what DNS returns, from which server, and whether it is authoritative, you can isolate name-resolution faults precisely. Combined with ipconfig to check configured DNS servers, nslookup makes DNS problems quick to find and fix.

Quick Check

Test your nslookup knowledge.

Recap

You learned nslookup. Key points:

  • nslookup queries DNS directly to resolve names and inspect records.
  • It shows the answering server and the resolved address.
  • Query specific types: A, AAAA, MX, CNAME, NS, TXT, PTR.
  • Ask a specific server to compare and find stale caches.
  • dig is a detailed Unix alternative with the same purpose.

Frequently asked questions

Is the “Querying DNS With Nslookup” lesson free?

Yes — the full text of “Querying DNS With Nslookup” is free to read here on the web, and the Network+ Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Network+ Academy course, upgrade to CoddyKit PRO.

What will I learn in “Querying DNS With Nslookup”?

Look up records and diagnose name-resolution problems. You practise Network+ Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Network+ Academy?

No prior experience is required. Network+ Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Querying DNS With Nslookup” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Network+ Academy lesson?

Yes. Every Network+ Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Testing Reachability With Ping
  2. Mapping the Path With Traceroute
  3. Viewing Settings With Ipconfig
  4. Querying DNS With Nslookup
← Back to Network+ Academy