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 5 months ago

Check DNS records on Windows with nslookup (2024)

FAQs

Check DNS records on Windows with nslookup? ›

To use this CMD DNS command on windows, first open your command prompt by pressing Windows+R, typing “cmd,” and clicking Ok. This step is the same for all commands on Windows. Then type “NsLookup” and hit Enter. As a result, you'll see your default server and your IP address.

How to check DNS records 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

How to use nslookup in Windows? ›

To use this CMD DNS command on windows, first open your command prompt by pressing Windows+R, typing “cmd,” and clicking Ok. This step is the same for all commands on Windows. Then type “NsLookup” and hit Enter. As a result, you'll see your default server and your IP address.

How to check if a DNS record exists? ›

Checking DNS records using the command line

The most efficient way to check DNS records of the domain is to use a terminal with the command nslookup. This command will run on almost all operating systems (Windows, Linux, and macOS).

How do you view your DNS records? ›

Use a website that gathers domain information, like WHOIS lookup, to look up public information about your name server. Search your domain name. Enter your domain name in the search field, such as mywebsite.com, and look up the domain information. Look for Name Server information in search results.

How do I lookup DNS in CMD? ›

Access your command prompt. Use the command nslookup (this stands for Name Server Lookup) followed by the domain name or IP address you want to trace. Press enter. This command will simply query the Name Service for information about the specified IP address or domain name.

How to use nslookup to verify DNS configuration? ›

At a command prompt, type nslookup , and then press Enter. Type <domain name> , where domain name is the name of your domain, and then press Enter. The MX record for the domain you entered should be displayed. If the MX record is not displayed, DNS is not configured properly.

How to check DNS is working properly? ›

Run ipconfig /all at a command prompt, and verify the IP address, subnet mask, and default gateway. Check whether the DNS server is authoritative for the name that is being looked up. If so, see Checking for problems with authoritative data.

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.

How to use nslookup command? ›

nslookup is a command-line tool to retrieve a domain's information, including its IP address and DNS record. To use this tool, enter “nslookup” in the Command Prompt or Terminal. Using various nslookup commands, you will get different information about your domain. This can help troubleshoot DNS-related issues.

What are nslookup options? ›

nslookup Options
nslookup OptionDescription
-timeout=[seconds]Specify the time allowed for the server to respond.
-type=aView information about the DNS A address records.
-type=anyView all available records.
-type=hinfoView hardware-related information about the host.
7 more rows
Jan 13, 2022

How to check CNAME records in nslookup? ›

How to lookup CNAME records on Windows
  1. Open a command prompt by navigating to Start → 'Type here to search' → 'cmd' → Open.
  2. Type nslookup -q=cname example.com and hit [enter] to get the CNAME records for example.com .
  3. The CNAME records are listed below the Non-authoritative answer heading.

What is the command to check DNS history? ›

Type cmd in the Start menu search bar to open Command Prompt. Then click Run as administrator. Enter the command ipconfig/displaydns and hit Enter. You'll see your detailed DNS cache history.

How do I extract DNS records? ›

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

How to check DNS records in Active Directory? ›

To use Nslookup to verify the SRV records, follow these steps:
  1. On your DNS, select Start > Run.
  2. In the Open box, type cmd .
  3. Type nslookup , and then press ENTER.
  4. Type set type=all , and then press ENTER.
  5. Type _ldap. _tcp. dc. _msdcs. Domain_Name , where <Domain_Name> is the name of your domain, and then press ENTER.
Dec 26, 2023

What is nslookup and how do you use it? ›

Nslookup is the name of a program that lets users enter a host name and find out the corresponding IP address or domain name system (DNS) record. Users can also enter a command in nslookup to do a reverse DNS lookup and find the host name for a specified IP address.

What is the nslookup command and what does it do? ›

nslookup is an abbreviation of name server lookup and allows you to query your DNS service. The tool is typically used to obtain a domain name via your command line interface (CLI), receive IP address mapping details, and lookup DNS records.

How do I use DNS on Windows? ›

Windows
  1. Go to the Control Panel.
  2. Click Network and Internet > Network and Sharing Center > Change adapter settings.
  3. Select the connection for which you want to configure Google Public DNS. ...
  4. Select the Networking tab. ...
  5. Click Advanced and select the DNS tab. ...
  6. Click OK.
  7. Select Use the following DNS server addresses.
Sep 22, 2022

How do I use DNS server on Windows? ›

From the Windows desktop, open the Start menu, select Windows Administrative Tools > DNS. Select and hold (or right-click) your server, and then select Properties. To limit the DNS server to use a specific IP address, select Only the following IP address, select the IP address you wish to use, and then select OK.

Top Articles
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 6260

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.