To check DNS records on Windows, open Command Prompt and run nslookup -type=a example.com, swapping a for mx, txt, ns, cname or soa to see other record types. In PowerShell, the equivalent is Resolve-DnsName example.com -Type MX, which gives tidier output and is easier to script. To see the current, authoritative answer rather than a cached one, add a server: query the domain's own nameserver, or a public resolver, at the end of the command.
Both tools are built into Windows 10 and Windows 11, so you do not need to install anything. Below are the exact commands for each record type, how to read the results, and how to deal with cached answers.
Opening the tools
- Command Prompt: press
Win + R, typecmdand press Enter. Or search for Command Prompt in the Start menu. - PowerShell or Windows Terminal: right-click the Start button and choose Terminal (Windows 11) or Windows PowerShell (Windows 10).
You do not need administrator rights for lookups. You only need them for some cache commands.
nslookup commands for each record type
| Record | Command | What it shows |
|---|---|---|
| A | nslookup -type=a example.com | IPv4 address of the site |
| AAAA | nslookup -type=aaaa example.com | IPv6 address |
| CNAME | nslookup -type=cname www.example.com | The name an alias points to |
| MX | nslookup -type=mx example.com | Mail servers and their priorities |
| TXT | nslookup -type=txt example.com | SPF, verification and other text records |
| DMARC | nslookup -type=txt _dmarc.example.com | The domain's DMARC policy |
| NS | nslookup -type=ns example.com | The domain's nameservers |
| SOA | nslookup -type=soa example.com | Primary nameserver, serial number and timers |
A plain nslookup example.com returns A and AAAA records. Asking for -type=any is rarely useful now, because many DNS servers deliberately return a minimal answer to that query.
Reading nslookup output
The first two lines show which DNS server answered, usually your router or your internet provider's resolver. "Non-authoritative answer" means the result came from a resolver's cache rather than directly from the domain's own nameserver. That is normal, but it can be out of date if a record was changed recently.
Querying a specific DNS server
Add the server name or IP address at the end of the command:
nslookup -type=mx example.com 1.1.1.1asks Cloudflare's public resolver.nslookup -type=mx example.com 8.8.8.8asks Google's public resolver.nslookup -type=mx example.com ns1.yourdnsprovider.comasks the domain's own nameserver directly.
To get the current, authoritative record:
- Run
nslookup -type=ns example.comand note one of the nameservers. - Run your query again with that nameserver at the end.
- Compare the answer with what your normal resolver returns. If they differ, your resolver is still serving a cached copy, which will update when its time to live (TTL) runs out.
Using PowerShell's Resolve-DnsName
PowerShell's built-in cmdlet does the same job with clearer output:
Resolve-DnsName example.com -Type AResolve-DnsName example.com -Type MXResolve-DnsName example.com -Type TXTResolve-DnsName example.com -Type NS -Server 1.1.1.1Resolve-DnsName example.com -Type A -DnsOnlyskips other name-resolution methods such as the hosts file.
The output includes the TTL in seconds for each record, which tells you how long resolvers may cache it. For a quick record of all the main types, you can run several lines and pipe the results to a file, for example by adding | Out-File dns.txt -Append to each command.
Copy and paste the TXT record exactly as returned when checking SPF or DKIM. Long TXT records may be split into several quoted strings, which DNS joins together.
When the answer looks wrong: caches
Windows keeps its own DNS cache, and so does your browser. If a site still loads the old server after a change:
- Run
ipconfig /flushdnsin Command Prompt, orClear-DnsClientCachein PowerShell (run as administrator). - Restart the browser, which clears its separate cache.
- Run
ipconfig /displaydnsif you want to see what Windows currently has cached. - Check the hosts file at
C:\Windows\System32\drivers\etc\hostsfor a leftover entry overriding the domain.
Your router and your internet provider also cache answers, and you cannot clear those. Query a public resolver or the authoritative nameserver to see past them. For how long caches can hold records, see what TTL to use for DNS.
Interactive mode for several lookups
If you are checking many records on one domain, type nslookup on its own and press Enter. You get a > prompt where you can type commands one after another:
server 1.1.1.1switches the DNS server for the rest of the session.set type=mxsets the record type.- Type the domain name, such as
example.com, to run the query. set type=txt, then the domain again, to see TXT records.exitto leave.
This saves retyping and makes it easy to compare the same record across several servers.
Common errors and what they mean
| Message | Likely meaning |
|---|---|
Non-existent domain | The name does not exist in DNS: a typo, an unregistered domain, or a domain that has expired or been put on hold |
No response from server or timed out | The DNS server you asked is unreachable or not answering |
| Answer but no records of that type | The domain exists but has no record of that type, for example no MX |
Server failed | The resolver could not get an answer, often a problem with the domain's nameservers or DNSSEC |
A non-existent domain result for a name you own is urgent. Check its expiry date and status straight away; our guide on whether a website is down because of the domain or the hosting walks through it.
Keeping a record of your DNS
Looking up records is easy. Knowing what they were last month, for every domain you own, is harder, and it is exactly what you need when something breaks or before you move hosts. Names Organizer, a domain manager for Windows, stores each domain's nameservers and DNS records alongside its registrar and expiry details, and it can warn you when nameservers or DNS records change unexpectedly. Its DNS and nameservers report lists the records per domain and can be printed or saved as PDF or text, which is handy before a website move or an audit. You still make changes at your DNS provider, but with Names Organizer you have a reference copy to compare against.
Frequently asked questions
How do I look up MX records on Windows?
Open Command Prompt and run nslookup -type=mx yourdomain.com, or in PowerShell run Resolve-DnsName yourdomain.com -Type MX.
Why does nslookup show a different result than my DNS provider?
Your resolver may be serving a cached answer. Query the domain's own nameserver directly to see the current authoritative records.
How do I clear the DNS cache on Windows?
Run ipconfig /flushdns in Command Prompt. Browsers keep their own cache too, so restart the browser if a site still looks old.
