Windows Troubleshooting Tip – Advanced DNS Query Debugging With NSLookup

Home > Blogs > Windows Server > Windows Troubleshooting Tip – Advanced DNS Query Debugging With NSLookup

Windows Troubleshooting Tip – Advanced DNS Query Debugging With NSLookup

Like This Blog 2 Mike Danseglio
Added by December 23, 2013

I’ve published a number of articles on following a simple and straightforward troubleshooting methodology. I advocate a simple and focused approach shown in Figure 1. You can see that symptom identification is the first step, followed by root cause analysis and problem resolution.

Figure 1. MikeDan’s Quick and Dirty Troubleshooting Methodology.

There’s lots of great tools built right in to Windows that will actually help when narrowing down network communications problems. One of my favorites is NSLookup. I’ve previously written about NSLookup and covered the basic use. This article focuses on deep DNS troubleshooting. I recommend you read Windows Troubleshooting Tip – NSLookup if you’re not already familiar with NSLookup.

Displaying Detailed Query Data
By default, NSLookup is user friendly. It only displays the basic name resolution information resolution for a target host. If you’ve researched DNS, you know that there can be a complex set of queries and responses with multiple servers involved before that resolution is returned to the client. And there’s an easy way to display all of that as it happens.

As an example I’m going to use NSLookup to resolve the hostname www.interfacett.com against my favorite DNS provider, Level 3. The DNS server at Level 3 I’ll use here is 4.2.2.6. Here’s the basic NSLookup for that scenario:

001-NSLookup-DNS-scenario

For ease of reading, here’s the text from that screenshot:
C:\>nslookup
Default Server: UnKnown
Address: 10.0.1.1

> server 4.2.2.6
Default Server: resolver8.level3.net
Address: 4.2.2.6

> www.interfacett.com
Server: resolver8.level3.net
Address: 4.2.2.6

Non-authoritative answer:
Name: www.interfacett.com
Address: 8.19.33.146

> _

Now I’ll turn on verbose debugging and re-run the same query. To set verbose debugging in NSLookup I just type set d2. Then I run the exact same query as before, with very different output.

002-NSLookup-DNS-debugging-quert

Because the entire response won’t fit in a single window, here’s the text from the query:

> set d2

> www.interfacett.com

Server:  resolver8.level3.net

Address:  4.2.2.6

 

————

SendRequest(), len 61

    HEADER:

        opcode = QUERY, id = 9, rcode = NOERROR

        header flags:  query, want recursion

        questions = 1,  answers = 0,  authority records = 0,  additional = 0

 

    QUESTIONS:

        www.interfacett.com.Phoenix.Interfacett.com, type = A, class = IN

 

————

————

Got answer (145 bytes):

    HEADER:

        opcode = QUERY, id = 9, rcode = NXDOMAIN

        header flags:  response, want recursion, recursion avail.

        questions = 1,  answers = 0,  authority records = 1,  additional = 0

 

    QUESTIONS:

        www.interfacett.com.Phoenix.Interfacett.com, type = A, class = IN

    AUTHORITY RECORDS:

    ->  Interfacett.com

        type = SOA, class = IN, dlen = 72

        ttl = 720 (12 mins)

        primary name server = ns-1995.awsdns-57.co.uk

        responsible mail addr = awsdns-hostmaster.amazon.com

        serial  = 1

        refresh = 7200 (2 hours)

        retry   = 900 (15 mins)

        expire  = 604800 (7 days)

        default TTL = 14400 (4 hours)

 

————

————

SendRequest(), len 61

    HEADER:

        opcode = QUERY, id = 10, rcode = NOERROR

        header flags:  query, want recursion

        questions = 1,  answers = 0,  authority records = 0,  additional = 0

 

    QUESTIONS:

        www.interfacett.com.Phoenix.Interfacett.com, type = AAAA, class = IN

 

————

————

Got answer (145 bytes):

    HEADER:

        opcode = QUERY, id = 10, rcode = NXDOMAIN

        header flags:  response, want recursion, recursion avail.

        questions = 1,  answers = 0,  authority records = 1,  additional = 0

 

    QUESTIONS:

        www.interfacett.com.Phoenix.Interfacett.com, type = AAAA, class = IN

    AUTHORITY RECORDS:

    ->  Interfacett.com

        type = SOA, class = IN, dlen = 72

        ttl = 720 (12 mins)

        primary name server = ns-1995.awsdns-57.co.uk

        responsible mail addr = awsdns-hostmaster.amazon.com

        serial  = 1

        refresh = 7200 (2 hours)

        retry   = 900 (15 mins)

        expire  = 604800 (7 days)

        default TTL = 14400 (4 hours)

 

————

————

SendRequest(), len 53

    HEADER:

        opcode = QUERY, id = 11, rcode = NOERROR

        header flags:  query, want recursion

        questions = 1,  answers = 0,  authority records = 0,  additional = 0

 

    QUESTIONS:

        www.interfacett.com.Interfacett.com, type = A, class = IN

 

————

————

Got answer (137 bytes):

    HEADER:

        opcode = QUERY, id = 11, rcode = NXDOMAIN

        header flags:  response, want recursion, recursion avail.

        questions = 1,  answers = 0,  authority records = 1,  additional = 0

 

    QUESTIONS:

        www.interfacett.com.Interfacett.com, type = A, class = IN

    AUTHORITY RECORDS:

    ->  Interfacett.com

        type = SOA, class = IN, dlen = 72

        ttl = 720 (12 mins)

        primary name server = ns-1995.awsdns-57.co.uk

        responsible mail addr = awsdns-hostmaster.amazon.com

        serial  = 1

        refresh = 7200 (2 hours)

        retry   = 900 (15 mins)

        expire  = 604800 (7 days)

        default TTL = 14400 (4 hours)

 

————

————

SendRequest(), len 53

    HEADER:

        opcode = QUERY, id = 12, rcode = NOERROR

        header flags:  query, want recursion

        questions = 1,  answers = 0,  authority records = 0,  additional = 0

 

    QUESTIONS:

        www.interfacett.com.Interfacett.com, type = AAAA, class = IN

 

————

————

Got answer (137 bytes):

    HEADER:

        opcode = QUERY, id = 12, rcode = NXDOMAIN

        header flags:  response, want recursion, recursion avail.

        questions = 1,  answers = 0,  authority records = 1,  additional = 0

 

    QUESTIONS:

        www.interfacett.com.Interfacett.com, type = AAAA, class = IN

    AUTHORITY RECORDS:

    ->  Interfacett.com

        type = SOA, class = IN, dlen = 72

        ttl = 719 (11 mins 59 secs)

        primary name server = ns-1995.awsdns-57.co.uk

        responsible mail addr = awsdns-hostmaster.amazon.com

        serial  = 1

        refresh = 7200 (2 hours)

        retry   = 900 (15 mins)

        expire  = 604800 (7 days)

        default TTL = 14400 (4 hours)

 

————

————

SendRequest(), len 37

    HEADER:

        opcode = QUERY, id = 13, rcode = NOERROR

        header flags:  query, want recursion

        questions = 1,  answers = 0,  authority records = 0,  additional = 0

 

    QUESTIONS:

        www.interfacett.com, type = A, class = IN

 

————

————

Got answer (53 bytes):

    HEADER:

        opcode = QUERY, id = 13, rcode = NOERROR

        header flags:  response, want recursion, recursion avail.

        questions = 1,  answers = 1,  authority records = 0,  additional = 0

 

    QUESTIONS:

        www.interfacett.com, type = A, class = IN

    ANSWERS:

    ->  www.interfacett.com

        type = A, class = IN, dlen = 4

        internet address = 8.19.33.146

        ttl = 300 (5 mins)

 

————

Non-authoritative answer:

————

SendRequest(), len 37

    HEADER:

        opcode = QUERY, id = 14, rcode = NOERROR

        header flags:  query, want recursion

        questions = 1,  answers = 0,  authority records = 0,  additional = 0

 

    QUESTIONS:

        www.interfacett.com, type = AAAA, class = IN

 

————

————

Got answer (121 bytes):

    HEADER:

        opcode = QUERY, id = 14, rcode = NOERROR

        header flags:  response, want recursion, recursion avail.

        questions = 1,  answers = 0,  authority records = 1,  additional = 0

 

    QUESTIONS:

        www.interfacett.com, type = AAAA, class = IN

    AUTHORITY RECORDS:

    ->  interfacett.com

        type = SOA, class = IN, dlen = 72

        ttl = 719 (11 mins 59 secs)

        primary name server = ns-1995.awsdns-57.co.uk

        responsible mail addr = awsdns-hostmaster.amazon.com

        serial  = 1

        refresh = 7200 (2 hours)

        retry   = 900 (15 mins)

        expire  = 604800 (7 days)

        default TTL = 14400 (4 hours)

 

————

Name:    www.interfacett.com

Address:  8.19.33.146

Remember that the queries were the same in both examples. The final result was the same in both examples. The difference is that with d2 set, I can see the entire process of name resolution.

How does this help? It tells me which servers are being queried and what records or referrals are returned from each. If I have a complex DNS architecture or if I believe an errant DNS server is handing out incorrect results, seeing the entire query process helps me find the spot along the resolution path where the failure occurs.
Mike Danseglio -CISSP / CEH
Interface Technical Training – Technical Director and Instructor

Videos You May Like

A Simple Introduction to Cisco CML2

0 3698 0

Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2

Configuring Windows Mobility Center and How to Turn it On and Off

1 1411 1

Video transcription Steve Fullmer: In our Windows training courses, we often share information about the Windows 8.1 Mobility Center. Mobility Center was introduced for mobile and laptop devices in Windows 7. It’s present and somewhat enhanced in Windows 8. Since we don’t have mobile devices in our classrooms, I decided to take a little bit … Continue reading Configuring Windows Mobility Center and How to Turn it On and Off

OSPF Adjacency Troubleshooting Solution – Getting Close to the OSPF adj

0 247 1

In this video, Cisco CCNA & CCNP instructor Mark Jacob shows how to troubleshoot OSPF Adjacency issues by showing the distance between routers with the show ip ospf neighbor command.

Write a Comment

See what people are saying...

    Share your thoughts...

    Please fill out the comment form below to post a reply.