Check DNS records on Windows with nslookup (2024)

Suggest Edits

There are many reasons why you might need to check the status of your Domain
Name System (DNS) records. For example, you might need to verify that updates
are correct or troubleshoot issues with accessing a service.

If you're a Cloud DNS user, you can
view your DNS records through the Cloud ControlPanel. In addition, Microsoft® Windows®
offers nslookup, a built-in tool for checking your DNS records from the
command line.

To access nslookup, open a command prompt window by selecting Start >
All Programs > Accessories > Command Prompt
.

Check a DNS record

To check a specific DNS record, you need to specify the nslookup command,
an optional record type (for example, A, MX, or TXT), and the host name
that you want to check.

Note: If you omit the record type, it defaults to A.

The following example shows how to check A records for rackspace.co.uk:

C:\Users\Administrator>nslookup rackspace.co.ukServer: cachens1.lon.rackspace.com>Address: 83.138.151.80Non-authoritative answer:Name: rackspace.co.ukAddress: 212.64.133.165

The first two lines of output specify the server to which the request
was directed. This server is the default server that your system uses for DNS
name resolution.

The second section gives the name of the record and the corresponding Internet
Protocol (IP) address. However, the answer in this section is
non-authoritative because it originates from a server
(cachens1.lon.rackspace.com) that isn't the root source for those records.

Get an authoritative answer

To get an authoritative answer you need to specify the authoritative (primary)
name server at the end of the request.

Use the -type=soa option to tell nslookup to display the
authoritative name server, as shown in the following example:

C:\Users\Administrator>nslookup -type=soa rackspace.co.ukServer: cachens1.lon.rackspace.com>Address: 83.138.151.80Non-authoritative answer:rackspace.co.uk primary name server = ns.rackspace.com responsible mail addr = hostmaster.rackspace.com serial = 1415913000 refresh = 3600 (1 hour) retry = 300 (5 mins) expire = 1814400 (21 days) default TTL = 300 (5 mins)ns.rackspace.com internet address = 69.20.95.4

The address labeled primary name server is the DNS authority for the
domain.

If you add the address of the authoritative name server
(ns.rackspace.com) to the first command, the record is now checked
against that name server.

C:\Users\Administrator>nslookup rackspace.co.uk ns.rackspace.comServer: ns.rackspace.comAddress: 69.20.95.4Name: rackspace.co.ukAddress: 212.64.133.165

Check when a cached record expires

DNS uses caching, which reduces the load on authoritative name servers.
However, as a result, records might be outdated. If the authoritative and
non-authoritative answers differ, you have a cached response from the resolver
name server that you're using. The length of time that a record is cached
depends on its time-to-live (TTL) value. The TTL is a number that is
specified in seconds.

To see how long a record is cached, include the debug option, as shown in
the following example:

C:\Users\Administrator>nslookup -debug rackspace.co.uk------------Got answer:HEADER: opcode = QUERY, id = 1, rcode = NOERROR header flags: response, want recursion, recursion avail. questions = 1, answers = 1, authority records = 2, additional = 2 QUESTIONS: 80.151.138.83.in-addr.arpa, type = PTR, class = IN ANSWERS: -> 80.151.138.83.in-addr.arpa name = cachens1.lon.rackspace.com ttl = 2466 (41 mins 6 secs) AUTHORITY RECORDS: -> 151.138.83.in-addr.arpa nameserver = ns2.rackspace.com ttl = 2466 (41 mins 6 secs) -> 151.138.83.in-addr.arpa nameserver = ns.rackspace.com ttl = 2466 (41 mins 6 secs) ADDITIONAL RECORDS: -> ns.rackspace.com internet address = 69.20.95.4 ttl = 12982 (3 hours 36 mins 22 secs) -> ns2.rackspace.com internet address = 65.61.188.4 ttl = 12985 (3 hours 36 mins 25 secs)------------Server: cachens1.lon.rackspace.comAddress: 83.138.151.80------------Got answer: HEADER: opcode = QUERY, id = 2, rcode = NOERROR header flags: response, want recursion, recursion avail. questions = 1, answers = 1, authority records = 2, additional = 2 QUESTIONS: rackspace.co.uk, type = A, class = IN ANSWERS: -> rackspace.co.uk internet address = 212.64.133.165 ttl = 279 (4 mins 39 secs) AUTHORITY RECORDS: -> rackspace.co.uk nameserver = ns.rackspace.com ttl = 17465 (4 hours 51 mins 5 secs) -> rackspace.co.uk nameserver = ns2.rackspace.com ttl = 17465 (4 hours 51 mins 5 secs) ADDITIONAL RECORDS: -> ns.rackspace.com internet address = 69.20.95.4 ttl = 15754 (4 hours 22 mins 34 secs) -> ns2.rackspace.com internet address = 65.61.188.4 ttl = 15727 (4 hours 22 mins 7 secs)------------Non-authoritative answer:Name: rackspace.co.ukAddress: 212.64.133.165

The response includes the following information:

  • The first Got answer section of this example is used to get the
    host name of the server from which you are requesting the A record.
    In this example, the host name is cachens1.lon.rackspace.com.
  • The second Got answer section relates to your actual request.
  • The HEADER section contains details about the type of request and
    its success.
  • The QUESTIONS section shows that the request was for A records
    for rackspace.co.uk.
  • The ANSWERS section displays one record with an IP address of
    212.64.133.165 and a TTL of 279 seconds (4 minutes 39 seconds).
  • The AUTHORITY RECORDS section specifies the name servers that
    correspond to the domain.
  • The ADDITIONAL RECORDS section lists A records for the name servers
    that are listed in the authority records section.

This response shows that the name server that the client computer uses will
reuse the same A record for rackspace.co.uk for the next 4 minutes and 39
seconds. If you run the same command on the authoritative name server, you
see the current maximum TTL for the record.

Updated 4 months ago

Check DNS records on Windows with nslookup (2024)

FAQs

How do I use nslookup to check DNS records? ›

Type nslookup domain_name and the command will return the A record for the domain you ran a query for. Type nslookup -q=XX domain_name where XX is a type of a DNS record and domain_name is the domain you want to look up the record for. Some of the available types of records are MX, A, CNAME, and TXT.

How do I check DNS server responses? ›

There are two primary ways you can test DNS server response time: through a ping test or a dig test.

How do I see full DNS records? ›

Online nslookup is a web based DNS client that queries DNS records for a given domain name. It allows you to view all the DNS records for a website. It provides the same information as command line tools like dig and nslookup, from the convenience of your web browser.

How do I view DNS entries in Windows? ›

The Command Prompt can be used to check the DNS server that is currently in use. This is how:
  1. Type Command Prompt into the Start menu, then select Run as Administrator from the right pane.
  2. Ipconfig /all should be entered into the Command Prompt window.
  3. The information displayed on the screen includes the DNS servers.
Oct 17, 2022

What is the command used to test DNS records? ›

The Nslookup command is available on many of the popular computer operating systems like Windows, macOS, and Linux distros. You can use it to perform DNS queries and receive: domain names or IP addresses, or any other specific DNS Records.

What is the equivalent of nslookup in Windows? ›

The Resolve-DnsName cmdlet performs a DNS query for the specified name. This cmdlet is functionally similar to the nslookup tool which allows users to query for names.

What is the difference between nslookup and dig commands? ›

nslookup is an easy-to-use tool for fundamental DNS queries, dig stands out for its rich feature set and thorough output. Dig is the tool of choice for experts and network administrators looking for comprehensive DNS analysis, troubleshooting, and the capacity to work with different record kinds.

How do I find DNS responses in Wireshark? ›

To analyze DNS response traffic:
  1. In the top Wireshark packet list pane, select the next DNS packet, labeled Standard query response CNAME wikiversity....
  2. Observe the packet details in the middle Wireshark packet details pane. ...
  3. Expand Ethernet II to view Ethernet details.
  4. Observe the Destination and Source fields.
Nov 19, 2023

How do I extract DNS records? ›

​​ Export records

Go to DNS > Records. Select Import and Export. Select Export.

What are nslookup options? ›

nslookup Options
nslookup OptionDescription
-type=anyView all available records.
-type=hinfoView hardware-related information about the host.
-type=mxView Mail Exchange server information.
-type=nsView Name Server records.
7 more rows
Jan 13, 2022

How to check DNS history Windows 10? ›

Windows: Open your command prompt and enter the command “ipconfig /displaydns.” You should then be able to see the records. Mac: Open the Terminal app, enter the command “sudo discoveryutil udnscachestats,” and input your password. This will display the Unicast DNS cache.

How to check DNS PowerShell? ›

DNS Record Lookup in Windows PowerShell

PowerShell uses its Resolve-DnsName cmdlet for record lookups. To specify what record, you must add “-type” to complete the cmdlet. PS C:\Users\username>Resolve-DnsName dnsmadeeasy.com -Type MX (or any record you choose).

What are DNS responses? ›

DNS message is relatively simple: the browser queries a domain name and gets an IP address. If a DNS server doesn't recognize the domain name, it will pass the query along to the following DNS server. Later, when receiving a response, it carries the response to the browser.

How do you detect DNS hijacking? ›

Common signs of DNS hijacking include web pages that load slowly, frequent pop-up advertisem*nts on websites where there should not be any, and pop-ups informing you that your machine is infected with malware. You can also identify DNS hijacking by pinging a network, checking your router, or checking WhoIsMyDNS.

Top Articles
Latest Posts
Article information

Author: Duncan Muller

Last Updated:

Views: 6478

Rating: 4.9 / 5 (79 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Duncan Muller

Birthday: 1997-01-13

Address: Apt. 505 914 Phillip Crossroad, O'Konborough, NV 62411

Phone: +8555305800947

Job: Construction Agent

Hobby: Shopping, Table tennis, Snowboarding, Rafting, Motor sports, Homebrewing, Taxidermy

Introduction: My name is Duncan Muller, I am a enchanting, good, gentle, modern, tasty, nice, elegant person who loves writing and wants to share my knowledge and understanding with you.