How to Check DNS Records with nslookup
nslookup is a built-in tool for asking DNS what it knows about a name. This guide shows the commands, how to read the answers and what to do when they look wrong.
9 min readUpdated Nov 19, 2026By XPASS Editorial Team

When a website does not load, email stops arriving or a new domain seems to ignore your settings, the first question is usually the same: what does DNS actually say about this name? You do not need special software to find out. A tool called nslookup comes with Windows and macOS, and is available on most Linux systems, and it can answer that question in a few seconds.
This guide explains what nslookup does, how to run it, how to ask for each common record type, how to choose which DNS server answers you, and how to read the output without guessing. It also covers the limits of the tool and the mistakes that lead people to wrong conclusions. If you prefer a more detailed command-line tool, the companion article on checking DNS with dig for beginners covers dig in the same plain style.
What nslookup does and when to use it
DNS, described in the foundational specifications RFC 1034 and RFC 1035, is the system that turns names such as www.example.com into the data computers need: an IP address for a website, a list of servers for email, text records for verification, and so on. When you type an address in a browser, your computer asks a resolver, which asks other servers on your behalf and remembers the answer for a while.
nslookup is a small client that sends those same questions by hand and prints what comes back. It is useful in situations such as these:
- You changed an A record and want to confirm the new IP address is being returned.
- You added MX records for email and want to confirm they are visible.
- A service asked you to publish a TXT record to verify ownership, and you want to check that it exists.
- You moved a domain to new name servers and want to see which ones the world is being told about.
- A site works on one network but not on another, and you want to compare answers.
It does not repair anything. It only shows you what DNS says, which is exactly what you need before deciding what to change.

Starting nslookup
You can use nslookup in two ways.
One question at a time. Open a terminal (Terminal on macOS, Command Prompt or PowerShell on Windows, any shell on Linux) and type the command with a name:
nslookup example.com
It prints the server it asked, then the answer, then returns you to the prompt. This is the form most people need, and it is easy to paste into notes or a support ticket.
Interactive mode. Type just nslookup and press Enter. You get a > prompt where you can enter several queries in a row and change settings between them, for example set type=MX and then example.com. Type exit to leave. Interactive mode is handy when you want to try many names against one server.
On some Linux systems the tool is not installed by default. It is usually part of a package with a name like dnsutils or bind-utils, depending on the distribution. If the command is not found, check your distribution's package list.
Checking the common record types
By default nslookup asks for the address of the name, which means A records, and on many systems AAAA records as well. To ask for a different record type, add -type= before the name.
| What you want to know | Command | What you should see |
|---|---|---|
| IPv4 address of a site | nslookup example.com |
One or more IPv4 addresses |
| IPv6 address of a site | nslookup -type=AAAA example.com |
One or more IPv6 addresses |
| Mail servers | nslookup -type=MX example.com |
Mail exchanger hostnames with preference numbers |
| Text records | nslookup -type=TXT example.com |
Quoted text strings such as verification codes |
| Name servers | nslookup -type=NS example.com |
The hostnames of the authoritative name servers |
| Alias | nslookup -type=CNAME www.example.com |
The target hostname, if the name is an alias |
| Zone details | nslookup -type=SOA example.com |
Primary name server, contact, serial number and timers |
A few notes on reading these:
- For MX records, a lower preference number means a higher priority. A domain with two mail servers will list both, and the one with the smaller number is tried first.
- A TXT answer may contain several records at once. That is normal, because many services each ask for their own TXT record on the same name.
- If you ask for the CNAME of a name that is not an alias, you will usually see a message saying no such record exists. That does not mean the name is broken; it means it is not an alias.
- To look up the name that belongs to an IP address (a reverse lookup), give the address instead of a name, for example
nslookup 192.0.2.10. The result depends on whether the owner of that address has published a PTR record.
Choosing which DNS server answers you
If you only give a name, nslookup asks the resolver your computer is configured to use. That is usually your router, your office network or your internet provider. The answer reflects that resolver's cache, so it may not match what someone on another network sees.
To ask a specific server, put its name or address after the name you are looking up:
nslookup example.com ns1.example.net
This is the most useful trick in the tool, and it lets you separate two questions that people often mix up:
- What does the domain's own name server say? Ask one of the servers shown by
nslookup -type=NS example.com. This is the answer as published. It does not involve a cache, so it shows your latest change immediately. - What does a resolver say? Ask your default resolver, or a different public one. This is the answer that real visitors get, and it may still contain an older record until the TTL expires.
If the authoritative server shows the new record and your resolver still shows the old one, your change is correct and you are waiting for caches to expire. If even the authoritative server shows the old record, the change was not saved correctly at your DNS provider. This one comparison solves a large share of "my change is not working" questions. For the timing side of the story, see how long DNS propagation takes.
In interactive mode you can switch server with server ns1.example.net and return to the default by typing server followed by your normal resolver, or by restarting nslookup.
Reading the output
A typical answer has two parts. The first lines show which server answered. The rest is the result.
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: example.com
Address: 203.0.113.25
Here is how to read it:
- Server and Address tell you which resolver was asked. Port 53 is the standard DNS port. If this is not the server you expected, you are testing the wrong place.
- Non-authoritative answer means the data came from a resolver that is passing along what it knows, rather than from a name server that holds the zone. It is the normal result when you query a resolver and it is not a warning. When you query the domain's own name server, this line is absent.
- Name and Address are the result. If several addresses are listed, the site is published on more than one, and clients may use any of them.
The exact layout of the output differs between Windows, macOS and Linux versions, so do not worry if yours looks slightly different. The ideas are the same.
Error messages are worth learning, too. NXDOMAIN or "Non-existent domain" means that the name does not exist in DNS at all, which usually points to a typo or a record that was never created. SERVFAIL means the server could not get a valid answer, often because of a broken delegation or a problem with the name servers. A timeout means the server did not answer in time, so try another server before assuming the domain is at fault.
A worked example
Imagine you own mybrand.example. You moved your website to a new host yesterday, and a colleague says the old site still appears for them. You want to know whether the problem is your DNS settings or just waiting.
- Find the name servers:
nslookup -type=NS mybrand.example. The answer lists two servers,ns1.dnshost.exampleandns2.dnshost.example. - Ask one of them directly:
nslookup mybrand.example ns1.dnshost.example. It returns the new host's IP address. That means your record is correctly published. - Ask your default resolver:
nslookup mybrand.example. It still returns the old IP address, marked as a non-authoritative answer. - Conclusion: nothing is wrong with your settings. The resolver is still holding the old answer until the TTL runs out. Waiting, or asking your colleague to retry later or from another network, is the right action.
Had step 2 shown the old address, the next move would be different: you would open your DNS provider's panel and check whether the record was actually saved, in the right zone, with the right name. The article on recommended DNS TTL values explains why lowering the TTL before a planned move shortens this waiting period.
Limits and what to watch for
nslookup is quick, but it has weaknesses, and knowing them prevents wrong conclusions.
- It shows one resolver's view. Different networks and resolvers can hold different cached answers. A single result from one place is not proof of what everyone sees.
- Your computer may not use DNS alone. Browsers can keep their own caches, and a local hosts file can override DNS completely. nslookup talks to DNS directly, so it may disagree with what your browser does. If a name resolves in nslookup but the browser shows something else, check for a hosts file entry or clear the browser and operating system caches.
- It is not a full diagnostic tool. Some systems treat nslookup as an older utility, and it hides details such as flags and the time left on cached records that dig displays. For deeper analysis, use dig.
- Short names can be expanded. Some systems add search suffixes to names you type, so a short name may be tested as
name.office.local. Use the full name, ideally ending in a dot, to avoid surprises. - Some query types are restricted. Many servers refuse or limit requests for all records at once, so ask for specific types.
- Trailing characters matter. A stray space, a missing letter or a pasted character from a document can produce NXDOMAIN for a name that is actually fine. Retype the name if the result looks impossible.
- Do not trust one query during a change. While a record is being updated, you may see answers flip between old and new as different servers respond. Repeat the query a few times and from more than one network.
Also remember that DNS data is public. nslookup only reads information that is already published, but you should still use it responsibly and avoid sending large volumes of queries to servers you do not manage.
Troubleshooting common results
| What you see | Likely meaning | What to do |
|---|---|---|
| NXDOMAIN | The name does not exist in DNS | Check spelling, and check that the record exists in the right zone |
| Old IP address after a change | A resolver is serving its cached answer | Compare with the authoritative server, then wait for the TTL |
| Different answers on different networks | Different caches, or a change still spreading | Query the authoritative server and recheck later |
| No MX records | The domain has no mail records, or the type was not requested | Run the MX query explicitly and check the DNS panel |
| TXT record missing | Not saved, saved on the wrong name, or not yet visible | Check the exact name the service asked for and query it directly |
| Timeout | The server did not respond | Try another server and check your network connection |
| Answer from nslookup differs from the browser | Browser cache or hosts file | Clear caches and inspect the hosts file |
When you are unsure where to start, work in this order: confirm the name servers with an NS query, ask one of them for the record you care about, then ask your own resolver, and compare. That sequence separates a configuration problem from a waiting problem more reliably than anything else.
Good habits for DNS checking
A few small habits make your checks more useful:
- Write down the exact command and the answer before you change anything, so you can see what changed afterwards.
- Check each record type that your change touches. Changing a website's address involves A and AAAA records; if only the A record was updated, visitors with IPv6 might still reach the old server.
- Test from more than one network when it matters, such as your office and a mobile connection.
- Keep a record of the TTL on the answers you are waiting for, since it tells you the longest time an old answer should remain.
- After a successful change, run the relevant queries one more time and save the results with the date.
If you are managing the domain itself and want to see where its records are edited, the domains page is a good place to start.
Summary
nslookup asks DNS a question and prints the answer, which makes it the quickest way to check what a domain currently publishes. Use a plain nslookup name for addresses, add -type= for MX, TXT, NS, CNAME and others, and name a specific server to see the records as the domain's own name server publishes them. Compare that with your default resolver to tell a wrong setting from a cache that has not expired. Remember that the output reflects one resolver's view, that browsers and hosts files can disagree with it, and that NXDOMAIN, SERVFAIL and timeouts each point to a different kind of problem. Whenever you want to review or edit the records behind a name, the domains page shows where to begin.
Frequently asked questions
What is nslookup used for?
nslookup sends a DNS query for a name and prints the answer. You use it to see which IP address a domain points to, which mail servers handle its email, what TXT records it publishes and which name servers are responsible for it.
What does Non-authoritative answer mean in nslookup?
It means the answer came from a resolver that was repeating information from its cache or from another server, not from a name server that holds the zone itself. The data is normally correct, but it may be slightly out of date until its TTL expires.
How do I check a specific record type with nslookup?
Add the type option before the name, for example nslookup -type=MX example.com or nslookup -type=TXT example.com. Supported types include A, AAAA, MX, TXT, NS, CNAME and SOA.
How can I ask a particular DNS server instead of my default one?
Write the server after the name, for example nslookup example.com ns1.example.net. Asking the domain's own name server shows the records as published, without any resolver cache in between.
Why does nslookup show a different answer from what I see in my browser?
Your browser and your operating system may use caches, a different resolver or a local hosts file. Compare the answer from your default resolver with the answer from the authoritative name server to find out where the difference comes from.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Ready to register your domain?
Search a name, compare extensions and pay once for the years you choose.
.com registration from $18.81 for the first year
Search domainsKeep reading

Domain & DNS Guides
How Long Does DNS Propagation Really Take?
DNS propagation is mostly a matter of caches expiring. See what controls the wait, how to check each layer, and how to plan changes so visitors notice nothing.
10 min read

Domain & DNS Guides
How to Check DNS with dig: A Beginner's Guide
dig shows exactly what DNS returns, including status codes, flags and TTLs. This beginner guide covers the commands you need and how to read every part of the output.
10 min read

Domain & DNS Guides
What Is DNS TTL and What Value Should You Set?
TTL decides how long resolvers may keep a DNS answer. Here is how to choose a sensible value, when to lower it, and why changes do not always appear at once.
10 min read