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 2Mike 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.

You may also like:  What is Enterprise Mode for Internet Explorer 11 and How to Enable It

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

Agile Methodology in Project Management

0 57 0

In this video, you will gain an understanding of Agile and Scrum Master Certification terminologies and concepts to help you make better decisions in your Project Management capabilities. Whether you’re a developer looking to obtain an Agile or Scrum Master Certification, or you’re a Project Manager/Product Owner who is attempting to get your product or … Continue reading Agile Methodology in Project Management

Creating Users and Managing Passwords in Microsoft Office 365

0 98 1

In this Office 365 training video, instructor Spike Xavier demonstrates how to create users and manage passwords in Office 365.

Detailed Forensic Investigation of Malware Infections – April 21, 2015

2 192 1

In this IT Security training video, Security expert Mike Danseglio (CISSP / CEH) will perform several malware investigations including rootkits, botnets, viruses, and browser toolbars.

Write a Comment

See what people are saying...

  1. MS

    Sigh, it insisted on putting the http:// on the leading end.

  2. MS

    To keep the dns suffix returns to just the item referenced, put a dot at the end of the query to tell nslookup this is a fully qualified name that doesn’t need to be examined with all dns suffixes;
    http://www.hotmail.com.
    http://www.cnn.com.
    and so forth.

Share your thoughts...

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