CS 330: Exploring DNS Using nslookup and Wireshark
Due: Tuesday, Sep 22, 2026 by 11:59 PM
Objective
In this exercise, you will:
- Use
ipconfigandnslookupto explore DNS functionality on your system. - Capture and analyze DNS traffic using Wireshark.
- Understand how DNS queries and responses work at both the command-line and packet levels.
- Compare DNS results across different tools and servers.
Part 1: Identify Your DNS Server
- Open a terminal or Command Prompt.
- Run the following command:
ipconfig /all
Answer:
- What is the IP address of the DNS server(s) configured on your system? If more than one is listed, record the one your computer is currently using or note the full set of configured servers.
Part 2: Capture DNS Traffic in Wireshark
Step 1: Start Wireshark Capture
- Open Wireshark.
- Select your active network interface (e.g., Ethernet or Wi-Fi).
- Click Start to begin capturing packets.
Step 2: Run DNS Queries While Capturing
While Wireshark is capturing, open your terminal and run the following commands one at a time:
nslookup -type=A google.com
nslookup -type=NS google.com
nslookup -type=MX gmail.com
Wait a few seconds between each command to ensure the traffic is captured.
- Once finished, return to Wireshark and click Stop to end the capture.
Step 3: Apply DNS Filter
In the Wireshark display filter bar, enter:
dns
This will isolate DNS query and response packets.
Questions:
- What transport layer protocol is used for DNS queries and responses — UDP or TCP? Why?
- What port number is used for DNS traffic?
- What is the IP address of the DNS server your computer queried?
Note: Most DNS lookups use UDP because the queries are small and fast. DNS may use TCP for larger responses, zone transfers, or when a UDP response exceeds the size limit.
What to Look for in Wireshark
When you inspect packets, pay attention to:
- Source and destination IP addresses
- Source and destination ports
- Whether the packet is a query or a response
- The DNS record type (for example,
A,NS, orMX) - The answer section and returned values
Part 3: Analyze DNS Packets in Wireshark
Step 1: Follow a DNS Conversation
Find the same domain name you queried with nslookup and examine the DNS query packet.
- In the packet list, locate a DNS query packet.
- Right-click on it and choose Follow → UDP Stream.
Answer:
- Which domain name was queried?
- Was the response successful?
- What IP address was returned?
- What transport layer protocol and port were used for this DNS exchange?
- Examine the DNS query message. How many “questions” does this DNS message contain? How many “answers” does it contain?
- Examine the DNS response message to the initial query message. How many “questions” does this DNS message contain? How many “answers” does it contain?
- To what IP address is the DNS query message sent? Is this the IP address of your default local DNS server?
Step 2: Analyze an MX Record Response
- Find a DNS MX response packet.
- Click on it, and in the Packet Details Pane, expand the “Answers” section.
Answer:
- What is the mail server domain name listed in the response?
- What is its priority value?
- Was the response authoritative? How can you tell?
Discussion Questions
- What are the differences between A, NS, and MX records?
- How is DNS resolution affected by caching?
- Why is it important for security tools to monitor DNS traffic?
Compare DNS Results Across Different Sources
In this part, compare the DNS results you observed earlier with information from other tools and servers. Choose at least two of the following methods and record the results for the same domain(s):
Option 1: Use an online DNS checker
Go to https://dnschecker.org/ and look up a domain such as google.com.
Option 2: Query a public DNS server
Use a public resolver such as Cloudflare:
nslookup -type=A google.com 1.1.1.1
Option 3: Inspect browser DNS requests
Open the Developer Tools in your browser, go to the Network tab, and reload a page. Look for DNS requests and note what domain names and IP addresses appear.
What to record:
For each source, note:
- the domain name queried,
- the returned IP address (if any),
- whether the result matched the result from your earlier
nslookupand Wireshark analysis, - any differences in timing, server used, or record type shown.
Questions:
- How consistent were the DNS responses across:
- Command line (
nslookup) - Wireshark capture
- Online DNS tools
- Browser Developer Tools
- Command line (
- Why might DNS responses differ across tools or servers?
Submission Instructions
Post your answers in Marmoset by the scheduled due date in the syllabus.
Please submit the following:
- Answers to all questions (including analysis and discussion).
- A copy of your Wireshark packet capture file (
.pcapng). - A screenshot of a DNS query in the UDP stream.
- A screenshot showing a DNS MX record with details expanded.
- Summary of observations from online DNS tools.
Double-check that your screenshots clearly show packet details and are legible.
