Seeing the Query and Response Messages

If you need to, you can direct nslookup to show you the queries it sends out and the responses it receives. Turning on debug shows you the responses. Turning on d2 shows you the queries as well. When you want to turn off debugging completely, you have to use set nodebug, since set nod2 turns off only level 2 debugging. After the following trace, we’ll explain some parts of the message output. If you want, you can pull out your copy of RFC 1035, turn to page 25, and read along with our explanation.

C:\> nslookup 
Default Server:  terminator.movie.edu 
Address:  192.249.249.3 

> set debug
> set type=mx
> oreilly.com.
Server:  terminator.movie.edu
Address:  192.249.249.3

------------
Got answer:
    HEADER:
        opcode = QUERY, id = 11, rcode = NOERROR
        header flags:  response, want recursion, recursion avail.
        questions = 1,  answers = 1,  authority records = 0,  additional = 1

    QUESTIONS:
        oreilly.com, type = MX, class = IN
    ANSWERS:
    ->  oreilly.com
        MX preference = 20, mail exchanger = smtp2.oreilly.com
        ttl = 21598 (5 hours 59 mins 58 secs)
    ADDITIONAL RECORDS:
    ->  smtp2.oreilly.com
        internet address = 209.58.173.10
        ttl = 21598 (5 hours 59 mins 58 secs)

------------
Non-authoritative answer:
oreilly.com
        MX preference = 20, mail exchanger = smtp2.oreilly.com
        ttl = 21598 (5 hours 59 mins 58 secs)

smtp2.oreilly.com
        internet address = 209.58.173.10
        ttl = 21598 (5 hours 59 mins 58 secs)
>
> set d2
> oreilly.com. 
Server:  terminator.movie.edu 
Address:  192.249.249.3

This ...

Get DNS on Windows Server 2003, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.