Module 1 · Addresses, Subnets and Packets · Lesson 4 of 9
DNS lookups in a capture
Run nslookup during a capture, pair each query with its reply by transaction ID, and read the record returned.
In this lesson · about 26 minutes
- Explain what a DNS query and response contain
- Match a query to its response with the transaction ID
- Recognise common record types and when DNS uses TCP
Whiteboard · watch and try
From a name to a number
Press Play. The tutor follows one lookup from your laptop to the server that knows the answer.
Tip: press Pause, then use the pen to work along on the board. Space plays and pauses; Ctrl+Z undoes your last mark.
The Domain Name System turns names like example.com into addresses. Your computer asks a resolver (a DNS server set by DHCP or by hand), which answers from its cache or asks other servers.
What's in a lookup
- Transaction ID: a random number the client puts in the query. The reply carries the same ID, which is how you pair them in a busy capture.
- Query name and type: what is being asked, such as
example.comtype A. - Answer: the record returned, with a time-to-live (TTL) saying how long it can be cached.
| Record | Holds |
|---|---|
| A | An IPv4 address |
| AAAA | An IPv6 address |
| CNAME | An alias pointing to another name |
| MX | The mail server for a domain |
| TXT | Free text, often used for email security (SPF, DKIM, DMARC) and domain verification |
| PTR | A reverse lookup: address to name |
UDP and TCP
Most lookups use UDP port 53 because it's quick. DNS also uses TCP port 53 for large responses that don't fit (the server sets a "truncated" flag and the client retries over TCP) and for zone transfers between servers. A firewall that blocks 53/TCP can break DNS in odd, intermittent ways.
Try it · watch it move
Follow a name lookup (DNS)
Step through a lookup the resolver has never seen, then turn on the cache and look it up again. Notice the ID on the question and the answer.
The resolver's notebook (cache)
nothing about example.com yet
Hands-on lab (simulated terminal)
Lab: pair a DNS query with its reply
Your lab resolver is 10.10.10.53. A capture is already running and will save to dns.pcap. Synthetic data: the addresses below are documentation and lab addresses.
Step 1 of 3. Type each command and press Enter. Nothing runs on your computer.
1. Look up example.com with nslookup.
Check your understanding0 of 3 correct
Quiz score: 0 of 3
Noviq Academy is free and for learning. Every lab here is simulated with synthetic data and private lab addresses. Only capture traffic and test networks that you own or have written permission to test. Wireshark and pfSense are trademarks of their owners; this course is independent of them.