Skip to content

How to Check DNS Records for a Domain and Read the Output

Learn how to query DNS records with dig, nslookup and online resolvers, and how to read TTLs, flags and answer sections correctly.

Editorial Team Updated 29 Oct 2026 DNS 2 min read 63 views
Share

Use dig for the most detailed answer, nslookup when dig is unavailable, and an online resolver when you want a quick check from another network. Read the answer section first, then the TTL, then the flags, because those three tell you what the domain currently publishes and how long caches will keep it.

What a DNS query actually returns

Every query returns a header, a question section, an answer section, and often authority and additional sections. The question section repeats what you asked. The answer section holds the records that match your query type. The authority section usually lists the zone's nameservers, and the additional section carries glue addresses.

A record type matters as much as the name. Asking for A returns IPv4 addresses, AAAA returns IPv6, MX returns mail servers, TXT returns text such as SPF and verification strings, and NS returns the delegated nameservers. If you ask for the wrong type, an empty answer does not mean the domain is broken.

DNS answers also come with a status code. NOERROR means the query was understood. NXDOMAIN means the name does not exist at all. SERVFAIL means the resolver could not complete the lookup, which often points to a broken delegation or an unreachable authoritative server.

Querying with dig: the core commands

The basic form is dig example.com. That returns the A record by default. To ask for a specific type, use dig example.com MX, dig example.com TXT or dig example.com NS.

To query a specific resolver instead of your system default, add @ followed by the address: dig @1.1.1.1 example.com A or dig @8.8.8.8 example.com AAAA. This is the fastest way to compare what different public resolvers return.

Use +short when you only want the values. dig +short example.com prints just the IP addresses. It is handy for scripts, but it hides flags and TTLs, so use it for confirmation rather than diagnosis.

For a full trace from the root servers down to the authoritative answer, run dig +trace example.com. This shows each delegation step and is the best tool when you suspect a nameserver change has not taken effect.

Reading the dig output line by line

A typical response starts with ;; ->>HEADER<<- opcode: QUERY, status: NOERROR. The status is your first check. Next come flags such as qr (this is a response), rd (recursion desired), ra (recursion available) and aa (authoritative answer).

If aa is present, the server that answered owns the zone. If it is absent, you received a cached or recursive answer. That distinction matters when you are debugging a recent change.

The ANSWER SECTION lists records with a name, TTL, class, type and value. For example, example.com. 3600 IN A 203.0.113.10 means the A record is 203.0.113.10 and caches may keep it for 3600 seconds.

The AUTHORITY SECTION normally shows the zone's NS records. The ADDITIONAL SECTION may show their IP addresses. If the authority section looks wrong, check the delegation at the registrar, not just the zone file.

Using nslookup when dig is not installed

On Windows, nslookup example.com works out of the box. On Linux and macOS it is usually available even when dig is not. The output is less structured but still readable.

To choose a record type, run nslookup -type=MX example.com or nslookup -type=TXT example.com. To query a specific resolver, add it as the second argument: nslookup example.com 1.1.1.1.

For nameserver checks, nslookup -type=NS example.com shows the delegated servers. On Windows you can enter interactive mode by typing nslookup, then set type=MX, then the domain name.

nslookup hides some detail, such as the full flag set, so treat it as a quick check. When the answer looks odd, repeat the query with dig or an online tool before drawing conclusions.

Checking common record types one by one

Start with dig example.com A and dig example.com AAAA to confirm the website address. Then check dig www.example.com because the www host is often a separate CNAME.

For email, run dig example.com MX and confirm the priority numbers and hostnames. Then check dig example.com TXT for SPF and verification records, and dig _dmarc.example.com TXT for the DMARC policy.

For delegation, run dig example.com NS. The answer should match the nameservers set at your registrar. If they differ, the registrar change has not propagated or was never saved.

For subdomains, query the exact name, such as dig api.example.com. A CNAME answer should point to a hostname, not an IP address. If you see a CNAME and other records at the same name, that zone has a configuration error.

What TTL values tell you about propagation

The TTL is the number of seconds a resolver may cache the record. A TTL of 300 means changes can take up to five minutes to appear widely. A TTL of 86400 means up to a day.

TTLs count down in cached answers. If you query the same record twice and the TTL drops from 3600 to 3590, you are seeing a cached copy, not the authoritative server.

To bypass caches, query the authoritative nameserver directly. First get the NS records, then run dig @ns1.provider.example example.com A using the nameserver address. If the authoritative answer is correct but public resolvers show the old value, you are simply waiting for caches to expire.

Lower the TTL well before a planned migration, not during it. Many providers let you set TTLs per record, but the exact minimum depends on the DNS host.

Using online resolvers to test from other networks

Online tools such as DNS Checker, whatsmydns.net and Google's Public DNS lookup page query your domain from multiple locations. They are useful because your local resolver may hold a cached answer that hides the truth.

Paste the domain, choose the record type, and compare results across regions. Differences usually mean caching, not a broken zone. If one region is wrong for longer than the TTL, investigate that resolver or the anycast path it uses.

Some tools also show the resolver IP and the response time. Slow responses from one region can point to routing issues rather than DNS data problems.

Remember that online tools are third party services. They are fine for diagnosis, but do not paste private hostnames or internal records into them.

Interpreting flags, status codes and odd answers

SERVFAIL often means the authoritative servers are unreachable, the zone is misconfigured, or DNSSEC validation failed. Check the delegation first, then the zone's DNSSEC settings.

NXDOMAIN for a name you expect to exist usually means a typo, a missing record, or a subdomain that was never created. Confirm with the authoritative server before editing anything.

A CNAME pointing to another CNAME is legal but adds latency. Long chains are worth flattening. A missing A record at the apex while www works is a common and easily fixed mistake.

If dig returns an answer but a browser fails, the problem may be local caching, a hosts file entry, or a VPN. Flush your local cache and test again with a public resolver.

Practical checks before and after a DNS change

Before changing records, record the current values with dig +short for each type and save the output. Note the current TTLs. Lower them if a migration is coming.

After the change, query the authoritative server directly to confirm the new data is live. Then query two public resolvers and one online tool. If the authoritative answer is right, the rest is cache timing.

Keep a short checklist: apex A and AAAA, www, MX, SPF and DMARC TXT, and NS. That covers most breakages. For hosting on Luveedu Cloud or any other provider, the nameservers and record values come from the hosting panel, so verify them there rather than assuming defaults.

Finally, document the resolver you tested with and the time of the query. DNS troubleshooting without timestamps turns into guesswork.

Frequently asked questions

What is the difference between dig and nslookup?

Both query DNS servers, but dig prints a detailed response with header flags, status codes, TTLs and all sections. nslookup is simpler and available on Windows by default. Use dig for diagnosis and nslookup for quick checks when dig is not installed.

Why do different resolvers show different DNS answers?

Resolvers cache records for the TTL period, so a recent change may appear in one place and not another. Different resolvers may also follow different anycast paths. If the authoritative server shows the new value, the remaining difference is cache expiry.

How do I find the authoritative nameservers for a domain?

Run dig example.com NS or nslookup -type=NS example.com. The answer lists the delegated nameservers. You can then query one directly, for example dig @ns1.provider.example example.com A, to bypass caches entirely.

What does SERVFAIL mean in a dig response?

SERVFAIL means the resolver could not complete the lookup. Common causes are unreachable authoritative servers, a broken delegation at the registrar, or failed DNSSEC validation. Check the NS records first, then the DNSSEC configuration.

How long should I wait after changing a DNS record?

Wait at least the old TTL before expecting global consistency. If the previous TTL was 3600 seconds, allow up to an hour. Lowering the TTL a day before a planned change reduces the waiting time considerably.

Was this guide helpful?

2 people found this guide helpful.

One account. Every service.

Built for the whole stack, not just the website.

Hosting, domains, email, DNS and security. One account, one support team, no handoffs.

Hosting Shared, cloud and VPS
Domains Register, transfer, renew
Email Business mail and security
DNS and security Anycast, SSL and WAF

Every service under one login.