How to Use the Windows 11 nslookup Command to Query DNS Records

When you type a website address into your browser, your computer does not actually know where that website lives on the internet. It must first query a Domain Name System (DNS) server to translate the human-readable domain name (like google.com) into a numerical IP address (like 142.250.80.46) that network equipment can understand.

The nslookup command is a built-in Windows 11 diagnostic utility that allows you to manually perform these DNS lookups from the command line. It is an essential tool for troubleshooting website connection failures, verifying DNS configurations, and diagnosing email delivery problems caused by incorrect mail server records.

Performing a Basic DNS Lookup

The simplest use of nslookup is to find the IP address associated with a domain name.

Step 1: Open the Terminal

Right-click the Start button and select Terminal or Windows PowerShell. The nslookup command does not require administrator privileges for basic queries.

Step 2: Query a Domain

Type the command followed by the domain name you want to look up and press Enter:

nslookup google.com

The output will contain two sections:

  • Server and Address: This identifies which DNS server your computer used to answer the query. By default, this is the DNS server assigned by your router or Internet Service Provider.
  • Non-authoritative answer: This section contains the actual result—the domain name and its resolved IP address(es). “Non-authoritative” simply means the answer came from a cached copy on your DNS server, not directly from the domain’s own nameserver. This is perfectly normal for everyday lookups.

Querying a Specific DNS Server

If your default DNS server is returning incorrect results (which can happen if its cache is stale or corrupted), you can instruct nslookup to bypass it and query a different, trusted DNS server directly.

To query Google’s public DNS server (8.8.8.8), append the server address after the domain name:

nslookup google.com 8.8.8.8

Other commonly used public DNS servers include:

  • Cloudflare: 1.1.1.1
  • Google (secondary): 8.8.4.4
  • Quad9: 9.9.9.9

Comparing results between different DNS servers is an excellent way to determine whether a website’s DNS records have recently changed and haven’t fully propagated yet across all servers worldwide.

Looking Up Specific DNS Record Types

A domain name has many different types of DNS records associated with it beyond just the basic IP address. The nslookup command can query any specific record type using the -type= flag.

MX Records (Mail Exchange)

MX records tell the internet which mail servers are responsible for receiving emails on behalf of a domain. If you are troubleshooting email delivery failures, checking MX records is essential.

nslookup -type=mx example.com

The output will list all configured mail servers and their priority numbers. The server with the lowest priority number is tried first.

TXT Records

TXT records are used for a variety of purposes, including email authentication (SPF, DKIM), domain ownership verification (for Google Search Console or Microsoft 365), and security policies.

nslookup -type=txt example.com

NS Records (Name Server)

NS records identify which nameservers are authoritative for a domain—in other words, which servers hold the official, master copy of all the domain’s DNS records.

nslookup -type=ns example.com

CNAME Records (Canonical Name)

A CNAME record maps one domain name to another (like an alias). If a subdomain is pointing to a different service (e.g., shop.example.com redirecting to a Shopify server), a CNAME record is typically responsible.

nslookup -type=cname shop.example.com

Using Interactive Mode

If you need to run multiple DNS queries in sequence, typing the full nslookup command each time can be tedious. You can enter the interactive mode by simply typing nslookup without any arguments and pressing Enter.

The prompt will change to >, indicating you are now inside the nslookup shell. From here, you can type domain names directly, change the query type using set type=mx, or switch the target DNS server using server 8.8.8.8.

To exit interactive mode, type exit and press Enter.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.