LAB: NS Lookup Command

Objective

By the end of this lab, students will be able to:

  • Understand the purpose of the NSLOOKUP command.

  • Explain how the Domain Name System (DNS) works.

  • Resolve domain names into IP addresses.

  • Resolve IP addresses back into hostnames (Reverse Lookup).

  • Query different DNS record types.

  • Use public DNS servers for troubleshooting.

  • Document and analyze DNS query results.

 


 

Background

The Domain Name System (DNS) is often called the phonebook of the Internet. Instead of remembering IP addresses like 142.250.190.78, users can type easy-to-remember names such as google.com.

The NSLOOKUP (Name Server Lookup) command is a network troubleshooting tool that allows administrators to query DNS servers to verify domain names, IP addresses, mail servers, and other DNS records.

 


 

Prerequisites

  • Windows 10 or Windows 11

  • Internet connection

  • Command Prompt access

 


 

Lab Scenario

You are a junior IT support technician. Several employees report they cannot access company websites. Your task is to verify whether the DNS server is correctly resolving domain names and identify any DNS-related issues.

 


 

Part 1 – Open Command Prompt

  1. Press Windows + R

  2. Type:

 
cmd
 
  1. Press Enter

 


 

Part 2 – Verify DNS Resolution

Type:

 
nslookup google.com
 

Example Output

 
Server:  dns.company.net
Address: 192.168.1.1

Non-authoritative answer:
Name:    google.com
Addresses:
142.250.72.14
2607:f8b0:4004:81b::200e
 

Questions

  1. What DNS server answered the request?

  2. What IPv4 address was returned?

  3. Was an IPv6 address also returned?

 


 

Part 3 – Lookup Another Website

Run the following commands:

 
nslookup microsoft.com
 
 
nslookup amazon.com
 

Complete the table.

 

Website IPv4 Address IPv6 Address Successful?
Google      
Microsoft      
Amazon      

 


 

Part 4 – Reverse Lookup

Find the hostname for a known IP address.

 
nslookup 8.8.8.8
 

Example

 
Name: dns.google
Address: 8.8.8.8
 

Questions

  • What hostname was returned?

  • Is reverse lookup always available?

 


 

Part 5 – Query a Specific DNS Server

Instead of using your local DNS server, query Google’s public DNS server.

 
nslookup google.com 8.8.8.8
 

Now query Cloudflare DNS.

 
nslookup google.com 1.1.1.1
 

Questions

  • Did both servers return the same IP address?

  • Which server responded faster?

  • Why might results differ?

 


 

Part 6 – Enter Interactive Mode

Start NSLOOKUP.

 
nslookup
 

The prompt changes to:

 
>
 

Exit interactive mode.

 
exit
 

 

Part 7 – Query MX (Mail Exchange) Records

Determine the email servers for Microsoft.

 
nslookup
 
 
set type=mx
 
 
microsoft.com
 

Example Output

 
microsoft.com
MX preference = 10
mail exchanger = microsoft-com.mail.protection.outlook.com
 

Questions

  • What is an MX record?

  • Why do organizations have multiple mail servers?

 


 

Part 8 – Query Name Server (NS) Records

 
nslookup
 
 
set type=ns
 
 
google.com
 

Example Output

 
google.com
nameserver = ns1.google.com
nameserver = ns2.google.com
 

Questions

  • How many DNS servers were listed?

  • Why are multiple DNS servers used?

 


 

Part 9 – Query Canonical Name (CNAME) Records

 
nslookup
 
 
set type=cname
 
 
www.microsoft.com
 

Questions

  • Was a CNAME returned?

  • What is the purpose of a CNAME record?

 


 

Part 10 – Troubleshooting

Attempt to resolve an invalid website.

 
nslookup fakecompany123456789.com
 

Observe the response.

Questions

  • What error message appeared?

  • Why did the lookup fail?

 


 

Part 11 – Compare Public DNS Servers

Run the following:

 
nslookup google.com 8.8.8.8
 
 
nslookup google.com 1.1.1.1
 
 
nslookup google.com 9.9.9.9
 

Complete the comparison table.

DNS Server Organization Successful Notes
8.8.8.8 Google Public DNS    
1.1.1.1 Cloudflare    
9.9.9.9 Quad9    

 


 

Critical Thinking

Answer the following questions.

  1. What is DNS?

  2. Why is DNS important?

  3. What is the purpose of NSLOOKUP?

  4. What is the difference between a forward lookup and a reverse lookup?

  5. What information does an MX record provide?

  6. Why are multiple DNS servers used?

  7. What happens if a DNS server is unavailable?

  8. What is the purpose of a CNAME record?

  9. Why would an administrator query a public DNS server?

  10. When would NSLOOKUP be used during troubleshooting?

 


 

Challenge Activity

Investigate the DNS records for the following domains.

 
nslookup google.com
 
 
nslookup microsoft.com
 
 
nslookup amazon.com
 
 
nslookup openai.com
 

Record your findings.

 

Domain IPv4 Address IPv6 Address MX Record NS Records
Google        
Microsoft        
Amazon        
OpenAI        

 


 

Deliverables

Students must submit:

  • Screenshot of each NSLOOKUP command.

  • Completed DNS lookup tables.

  • Answers to all lab questions.

  • A comparison of Google, Cloudflare, and Quad9 DNS servers.

  • A one-page summary explaining how DNS works and how NSLOOKUP can be used to troubleshoot DNS problems.

 


 

Learning Outcomes

Upon successful completion of this lab, students will be be able to:

  • Explain the purpose of DNS and domain name resolution.

  • Use NSLOOKUP to perform forward and reverse DNS lookups.

  • Query common DNS record types (A, AAAA, MX, NS, and CNAME).

  • Compare responses from different public DNS servers.

  • Diagnose common DNS resolution problems.

  • Apply NSLOOKUP as a practical troubleshooting tool in real-world networking environments.

 


 

Bonus Activity (Advanced)

Research and explain the following DNS record types, then use NSLOOKUP (where applicable) or online DNS tools to investigate them for a domain of your choice.

DNS Record Purpose Example
A Maps a hostname to an IPv4 address example.com → 93.184.216.34
AAAA Maps a hostname to an IPv6 address example.com → 2606:2800:220:1:248:1893:25c8:1946
MX Identifies mail servers for a domain mail.example.com
NS Lists authoritative name servers ns1.example.com
CNAME Creates an alias for another hostname www.example.com → example.com
TXT Stores text information such as SPF, DKIM, and domain verification Used for email security and ownership verification

 

Reflection: Explain why DNS is considered one of the most critical services on the Internet and describe how an incorrect DNS configuration can affect users, websites, and email services.