Demo: following a URL with nslookup and the Network tab
On This Lesson 11 topics
Lesson Overview
This is a hands-on walkthrough. You will take one real URL and follow it from start to finish with two tools: nslookup, a command-line program that asks DNS for a domain's IP address, and the browser's Network panel, which shows the request and response. The result is a first-hand view of the journey from Lesson 4: DNS lookup, then request, then response.
This lesson also prepares the module lab, Follow a request. You will practise each step here on a safe, public example, then repeat it on domains of your choice in the lab.
You will also meet a planned mistake. We deliberately type a command wrongly, see the error, and fix it. Learning to read an error message calmly is one of the most valuable beginner skills, and nslookup fails in a very instructive way when given a URL instead of a domain.
This lesson builds on Lesson 3 (DNS), Lesson 4 (requests and responses), and Lesson 6 (the Network panel). It also uses the terminal from BEG-001 only lightly: you will type one short command.
Learning Objectives
By the end of this lesson you will be able to:
- Open a terminal on your operating system and run
nslookupwith a domain name. - Read the output and find the IP address of the domain, and tell it apart from the address of the DNS server you asked.
- Explain why some domains return several addresses.
- Explain why
nslookupneeds a domain and not a full URL. - Load the same site with the Network panel open and identify the main document's method, status code, and type.
- Connect the
nslookupresult to the step of the URL-to-page journey it represents. - Record your findings clearly enough to use as lab evidence.
Written Explanation
The plan
We will follow this URL: https://example.com. The domain example.com is reserved by the Internet Assigned Numbers Authority (IANA) for use in documentation and examples, which makes it a considerate choice for practice.
Our plan has two halves.
| Half | Tool | Question it answers | Step of the journey |
|---|---|---|---|
| 1 | nslookup in a terminal | What IP address does this domain point to? | DNS lookup |
| 2 | Network panel in a browser | What did the browser ask for, and what came back? | Request and response |
Half 1: asking DNS with nslookup
What nslookup does
Microsoft's documentation describes nslookup as a tool that displays information you can use to diagnose DNS. It exists in two forms of use:
- Non-interactive mode (also called command mode): you put everything on one line, and it prints an answer and exits. This is what we will use.
- Interactive mode: you type
nslookupalone, get a>prompt, and type several lookups. You leave it by typingexit.
In non-interactive mode the first value after the command is the name to look up. An optional second value is the DNS server to ask. If you leave it out, nslookup uses your computer's default DNS server (the resolver from Lesson 3).
The command is available on Windows and is also widely available on macOS and Linux, although on some Linux systems you may need to install it. Menu names for opening a terminal depend on your system, so use these as a guide:
- Windows: search for "Command Prompt" or "PowerShell" in the Start menu.
- macOS: open the app called "Terminal".
- Linux: open your distribution's terminal program.
Running it
Type the following and press Enter:
nslookup example.comYou do not type the word https:// and you do not type a slash. Just the domain.
Reading the output
The exact layout differs between operating systems and versions, so the following is an illustrative example using documentation addresses, not a real result. Your own output will show real values.
Server: dns.mynetwork.example
Address: 192.0.2.53
Non-authoritative answer:
Name: example.com
Addresses: 2001:db8::10
192.0.2.10How to read it:
- The first block (
ServerandAddress) describes the DNS server that answered you. This is your resolver, not the website. It is easy to mistake the firstAddressline for the answer, but it is not. - The block after it, starting with
Name, is the answer about the domain you asked for. The lines labelledAddressorAddresseshere hold the domain's IP addresses. This is where the answer lives. - You may see two kinds of address. The dotted one (
192.0.2.10) is IPv4. The one with colons (2001:db8::10) is IPv6 (Lesson 2). - The phrase non-authoritative answer commonly appears when the answer came from a resolver's cache rather than straight from the domain's own authoritative server (Lesson 3). It is normal and nothing to worry about. Whether it appears can vary with your network.
So: the IP address of the domain is on the lines after the Name: line, and the address near the top belongs to the DNS server. That is the answer to a typical beginner question: "Which line holds the IP address?"
Why more than one address?
Run the command on two more domains of your choice, for example a news site and a large online service. Some will return one address and some several, and some will return both IPv4 and IPv6. Several addresses usually mean the site runs on more than one server, for capacity and reliability (Lesson 3). If you run the command again a bit later, or on a different network, the list or its order may change. That is normal, and it is why a single number is a snapshot, not a permanent fact.
The result may also differ from the result a friend gets in another country, because big sites often direct visitors to a nearby server.
Common error messages
Microsoft's documentation lists several error messages that nslookup can show. The most useful for you now are:
| Message | Plain-language meaning |
|---|---|
| Nonexistent domain | The name does not exist (often a typo) |
| No response from server, or timed out | The DNS server did not answer in time |
| No records | The name is valid but has no records of the kind requested |
| Server failure, or Refused | The DNS server had a problem or declined the request |
Exact wording differs between operating systems, so treat these as a guide.
The planned mistake: giving nslookup a URL
Now let us make the planned mistake on purpose. Type:
nslookup https://example.comThis is the kind of thing beginners often try, because the thing in the browser's address bar is a URL. But nslookup works with names (and IP addresses), not URLs. https://example.com is not a domain: it is a scheme (https://) plus a domain. DNS has no record for the whole text, so the lookup fails. You will most likely see an error such as "Nonexistent domain" or a similar message, though the exact text depends on your system and DNS server. If your system behaves differently, note down what you see.
The fix: use only the domain name.
nslookup example.comThe lesson: a URL is more than a domain (Lesson 3). nslookup wants only the domain part, which is the host. When a tool fails, ask first: "Did I give it the kind of thing it expects?"
Half 2: watching the request in the browser
Now we follow the same site in the browser, using what you learned in Lesson 6.
- Open a new browser tab but do not load a page yet.
- Open developer tools and select the Network panel. Shortcuts vary by browser; see Lesson 6 or search for "open Network tab" with your browser's name.
- Type
https://example.comand press Enter, or reload the page if it is already open. - Find the main document. It is typically the first row, with type
document. On a very simple page there may be only a few rows. - Read three things from it: the method (usually
GET), the status code (usually200), and the type (document). If the method is not shown as a column, click the row and look at the Headers tab.
Expected result, subject to what your browser and the site show on the day: GET, 200, and document.
If the site redirected you first (for example from http to https), you may see a 301 or 302 row before the 200. Record both. The row for the page that finally arrived is the main document.
Connecting the two halves
This is the moment where the module's diagram becomes real.
| Journey step (Lesson 4) | What you did |
|---|---|
| Type the URL | You entered https://example.com |
| DNS lookup | nslookup example.com showed you the IP address |
| Connection | The browser opened a connection to that address on port 443 (the default for https) |
| Request | The Network panel showed GET for the main document |
| Response | The panel showed status 200 and type document |
| Render | The browser drew the page |
One caveat: the address the browser actually connects to may differ from the one nslookup printed, because a domain can have several addresses and the browser picks one. Both belong to the same domain.
Notice also what nslookup cannot tell you. It tells you where the domain points. It does not tell you whether a web server is running there, whether the request will succeed, or what the page contains. That is why you need both tools.
Recording evidence for the lab
The module lab asks for screenshots plus labelled answers. A good way to record your work:
- For each domain, write the domain, the command you typed, and the IP addresses you found, with IPv4 and IPv6 labelled.
- For the browser, take a screenshot of the Network panel that shows the main document row, and write beside it: Method, Status, Type.
- Avoid including cookies, tokens, or personal data in screenshots.
Examples
Example 1: One domain, one lookup (simple)
You run nslookup example.com and get this (illustrative values):
Name: example.com
Addresses: 2001:db8::10
192.0.2.10Answer the question: "What is the IPv4 address?" It is 192.0.2.10, the one with four numbers separated by dots. The one with colons is IPv6. The two lines are both addresses of the same domain.
Example 2: A domain that returns many addresses (practical)
You look up a large service and the output lists six addresses. Your friend, on another network, sees a different set. You conclude:
- The domain points to many servers (capacity and reliability).
- The sets can differ by place and time, so neither of you is wrong.
- If you wanted to monitor the site, you would not rely on one fixed address. You would look the name up each time.
This confirms what Lesson 3 said: a domain is a name that points to one or more servers, not a server.
Example 3: A confusing error, solved by reading (realistic)
A teammate says, "nslookup says the site does not exist, but I can open it in my browser." You ask what exactly they typed.
They typed nslookup https://shop.example.com/. You remove the scheme and the trailing slash and run nslookup shop.example.com. It returns an address.
Next you check the Network panel on the same site: the main document is GET, status 200, type document. The site exists, and the earlier error was caused by the input, not by the site. The teammate learned the rule: give DNS tools a domain, not a URL. Reading the error, checking the input, and testing the smallest version of the command is an everyday backend skill.
Backend Insight
The pair of tools you used here is the same pair that backend developers use to diagnose "it doesn't load" problems.
nslookupanswers "where does this name point right now?" If a new deployment is unreachable, you check whether the domain returns the address you expect. If it returns an old one, the cause may be DNS caching (Lesson 3).- The Network panel answers "what was asked and what came back?" If the address is right, you look at the request's method and the response's status code to see whether your backend answered as intended.
- Combine them. If DNS is right and the response is a
5xx, the problem is your server. If DNS returns the wrong address or none, the problem is before your server is ever reached.
This split, finding the server and talking to the server, is a habit that will serve you in every networking topic that follows. In the roadmap, the foundation laid here supports later topics on HTTP and APIs.
Common Mistakes
Mistake 1: Passing a URL to nslookup
- Incorrect:
nslookup https://example.com - Correct:
nslookup example.com
A URL is a scheme plus a domain plus more. nslookup wants the domain only.
Mistake 2: Reading the DNS server's address as the site's address
The Server and first Address lines near the top describe the resolver that answered you. The site's addresses appear after the Name: line.
Mistake 3: Expecting the same addresses every time
Large sites return different or several addresses depending on place and time. A single run is a snapshot.
Mistake 4: Starting the Network panel after loading
As in Lesson 6, the panel records only while open. Open it first, then reload.
Mistake 5: Assuming nslookup proves the website works
A correct address only shows where the name points. The server there may be down or may answer with an error. Use the Network panel to check the response.
Exercises
Try each exercise yourself before opening the solutions.
Level A: Foundation
A1. What command looks up the IP address of the domain example.org?
Show solution A1
A1. nslookup example.org
A2. In nslookup output, which block describes the DNS server and which describes the domain?
Show solution A2
A2. The first block (Server and Address) describes the DNS server that answered. The block starting with Name describes the domain you asked about, and its address lines are the IP addresses.
A3. What three things do you read from the main document row in the Network panel?
Show solution A3
A3. The method (for example GET), the status code (for example 200), and the type (for example document).
Level B: Application
B1. You run nslookup on a domain and see one IPv6 address and two IPv4 addresses. How many addresses is that, and what does it suggest about the site?
Show solution B1
B1. Three addresses: one IPv6 and two IPv4. It suggests the site runs on more than one server, for capacity and reliability, and supports both IP versions.
B2. A classmate typed nslookup https://example.org/ and got an error. Explain why and give the corrected command.
Show solution B2
B2. nslookup expects a domain name. https://example.org/ is a URL (scheme, domain, and path), so DNS has no record for that exact text. The corrected command is nslookup example.org.
B3. Describe, in order, which tool you use for each step: finding the IP address of the server, and seeing the status code of the main page.
Show solution B3
B3. Use nslookup for the IP address (the DNS lookup step). Use the browser's Network panel for the status code of the main document (the request and response step).
Level C: Challenge
C1. A new site was just moved to a new server. nslookup returns the new address on your laptop but the old address on your friend's laptop. Give two likely reasons and say what the Network panel would help you check afterwards.
Show solution C1
C1. The two laptops may use different resolvers with different cached answers (an old answer persists until the TTL expires), or the site may direct different visitors to different addresses. The Network panel can then show, on each laptop, whether the main document response is 200 or an error, and the response may reveal which server answered if it includes identifying headers. (Whether it does depends on the site.)
C2. You run nslookup and get the right address, but the browser's Network panel shows status 503 for the main document. Explain what each result tells you and where the problem most likely is.
Show solution C2
C2. The right address shows DNS is working and the domain points to the server you expect. A 503 means the server answered but says it is not ready, often because of overload or maintenance. So the problem is most likely on the server side, not in DNS.
Mini Challenge
This is a dress rehearsal for the lab.
- Choose three public domains. Write them down.
- For each, run
nslookupwith only the domain, and record the IP addresses. Label them IPv4 or IPv6. Note whether any domain returned more than one address. - Deliberately run
nslookuponce with a full URL, write down the error you get, then run the corrected command. - Open one of the sites with the Network panel open, reload, and identify the main document. Record its method, status code, and type.
- Write one sentence explaining what
nslookuptold you and one explaining what the Network panel told you.
Check your work: all answers are labelled, you did not give a URL to nslookup in your final results, and your two sentences are about different steps of the journey (finding the server versus talking to it).
Summary & Next Lesson
Key takeaways
nslookup <domain>asks DNS for a domain's IP address. Use a domain, not a URL.- In the output, the first
ServerandAddresslines are the resolver. The domain's addresses come after theName:line. - A domain can return several addresses, including IPv4 and IPv6, which can vary by place and time.
- The Network panel shows the main document's method, status code, and type: typically
GET,200, anddocument. nslookupshows where a name points. The Network panel shows what happened when the browser asked.- Reading error messages and checking your input is the quickest way to fix mistakes.
Next lesson
This is the last lesson of the module. You are ready for the lab, Follow a request, and for the next module, which builds on this vocabulary. Complete the lab, then draw and narrate the URL-to-page sequence from memory as your assessment.
Self-check
- Which command finds the IP address of a domain?
- What should you type after
nslookup: a URL or a domain? - Which line group in the output holds the website's address?
- Where do you see the status code of the main page?
- Why might the same domain return different addresses on two networks?
Show answers
nslookupfollowed by the domain name.- A domain, such as
example.com, withouthttps://. - The lines after the
Name:line, not theServerandAddresslines at the top. - In the browser's Network panel, on the main document's row.
- Large sites can run on several servers, direct visitors to nearby ones, and resolvers keep different cached answers.
References
- Microsoft Learn, nslookup. Supports what
nslookupdoes, the non-interactive and interactive modes, the formnslookup name [server], and the error messages. The sample output shown in this lesson is illustrative and its layout differs between operating systems. - IANA, Example domains. Supports
example.combeing maintained for documentation use. - Chrome for Developers, Inspect network activity. Supports opening the Network panel, recording while it is open, and the Status and Type columns.
- Mozilla Developer Network, How the web works. Supports the DNS lookup then request then response sequence. The description of "non-authoritative answer" and the exact error you get for a URL are not verified here, so they are hedged in the text.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.