DNS Lookup
A DNS lookup queries the Domain Name System for the records attached to a domain name, such as A and AAAA records for IP addresses, MX records for mail servers, TXT records for SPF and DKIM, and NS records for nameservers. Our DNS lookup tool queries the resolver you pick (Google 8.8.8.8, Cloudflare 1.1.1.1, Quad9 9.9.9.9, OpenDNS 208.67.222.222, or the domain's own authoritative nameservers), and Compare All queries them side by side so you can see which resolvers are still serving an old answer.
Command Line
DNS tools
What is the difference between a recursive resolver and an authoritative nameserver?
A recursive resolver such as Google Public DNS (8.8.8.8) answers from its cache, so it may return a record that has since changed. An authoritative nameserver holds the zone itself and answers with the record as it exists right now. Comparing the two is the quickest way to confirm whether a DNS change has taken effect or is still cached somewhere.
Our DNS lookup tool queries records from multiple public DNS resolvers simultaneously, including Google Public DNS (8.8.8.8), Cloudflare (1.1.1.1), Quad9 (9.9.9.9), and OpenDNS (208.67.222.222). You can also query the domain's authoritative nameservers directly for the most up-to-date records. The tool supports eleven record types: A, AAAA, MX, TXT, CNAME, NS, SOA, PTR, SRV, NAPTR and CAA. For MX and NAPTR it also follows the chain to the resolved IP addresses and shows the geolocation and ASN of each one.
What do the DNS record types mean?
A Record
Maps a domain to an IPv4 address. The most fundamental DNS record type, used to point your domain to a web server.
AAAA Record
Maps a domain to an IPv6 address. Essential for IPv6 connectivity as the internet transitions from IPv4.
MX Record
Specifies mail servers for a domain with priority values. Lower priority numbers indicate preferred servers for email delivery.
TXT Record
Holds arbitrary text data. Commonly used for SPF email authentication, DKIM signatures, domain verification, and DMARC policies.
CNAME Record
Creates an alias from one domain to another. Used to point subdomains to other hostnames without duplicating A records.
NS Record
Delegates a domain or subdomain to specific nameservers. Defines which DNS servers are authoritative for the zone.
SOA Record
Contains zone administration details including the primary nameserver, admin email, serial number, and refresh intervals.
PTR Record
Maps an IP address back to a hostname (reverse DNS). Mail servers check PTR records when deciding whether to accept a connection.
SRV Record
Advertises the host and port for a named service such as _sip._tcp, with priority and weight values for failover and load balancing.
NAPTR Record
Holds a rewrite rule that tells a client which service and which further lookup to perform next. Used for SIP server location and ENUM.
CAA Record
Specifies which Certificate Authorities are allowed to issue SSL/TLS certificates for the domain, preventing unauthorized issuance.
DNSSEC
Signs a zone with DNSKEY, DS and RRSIG records so resolvers can verify that an answer was not tampered with in transit.
Why do DNS results differ between resolvers?
DNS results can vary between resolvers due to caching with different TTL values, geographic DNS routing (GeoDNS), and filtering by some resolvers. Each resolver caches records independently and only discards a record when its TTL expires, so one resolver can still be serving the previous value after another has picked up the change. Some domains use GeoDNS and answer differently depending on where the query comes from. Filtering resolvers such as Quad9 withhold answers for domains they classify as malicious.
Querying the authoritative nameserver takes caching out of the picture. It holds the zone itself, and its answer is the one every other resolver will pick up once their cached copies expire. Comparing results across Google (8.8.8.8), Cloudflare (1.1.1.1), Quad9 (9.9.9.9) and the authoritative nameservers helps identify propagation issues after making DNS changes.
How long does DNS propagation take?
DNS propagation is the time it takes for a DNS change to be seen by every resolver, and it is really just cache expiry. Authoritative nameservers are updated the moment the zone is published. What takes time is the recursive resolvers that already hold the old record, and each of them keeps its cached copy for the TTL that was in force when it fetched the record.
A record with a 300-second TTL is fully replaced within five minutes. A record with an 86,400-second TTL can take up to 24 hours. Since the wait is governed by the old TTL, lowering a TTL speeds up the next change and not the current one. Lower it at least one full TTL period before a cutover, make the change, and raise it again once the new record is everywhere.
To check propagation, compare the answer from several resolvers. The Compare All option on this page does that for Google, Cloudflare, Quad9, OpenDNS and the authoritative nameservers, and our DNS propagation checker is built for that one job. A resolver that still returns the old value has not expired its cache yet, and there is nothing to do but wait for its TTL to run out.
Is there a DNS lookup API?
Yes. Every lookup on this site is a GET URL on api.dnsx.dev, with the record type and then the domain in the path, and it returns JSON whatever client requests it. Add format=raw to get dig-style plain text instead, one record per line, which is handy in shell scripts. There is no signup and no API key. The limit is 200 requests a day per IP address, and the response headers tell you how many you have left. The full reference, with every endpoint and response shape, is at docs.dnsx.dev.
curl https://api.dnsx.dev/dns/mx/gmail.com curl "https://api.dnsx.dev/dns/txt/example.com?format=raw"
How do I look up DNS records from the command line?
With a local resolver, dig does the same job as the API. It ships with macOS and with the bind-utils or dnsutils package on Linux, and it can query every record type on this page.
- Query a record type with dig. Run dig example.com MX +short to list the MX records for a domain. Replace MX with A, AAAA, TXT, CNAME, NS, SOA, SRV, NAPTR or CAA to query another type.
- Pick a resolver. Add the resolver address after an @ sign, as in dig @8.8.8.8 example.com MX +short, to ask Google Public DNS instead of your system resolver. Use @1.1.1.1 for Cloudflare or @9.9.9.9 for Quad9.
- Query the authoritative nameserver. Run dig example.com NS +short to find the nameservers for the domain, then dig @ns1.example.com example.com MX to read the record straight from the zone, with no cache in between.
dig example.com MX +short dig @8.8.8.8 example.com MX +short dig example.com NS +short dig @ns1.example.com example.com MX
How do I look up DNS records on Windows?
Windows ships with nslookup, and PowerShell adds Resolve-DnsName. Both can query A, AAAA, MX, TXT, CNAME, NS, SOA, SRV and PTR records, and both accept a resolver address so you can compare answers from Google or Cloudflare with your local resolver. Neither can query NAPTR records, so for those use WSL or the DNSX API.
nslookup -type=MX example.com nslookup -type=TXT example.com 8.8.8.8 Resolve-DnsName example.com -Type MX Resolve-DnsName example.com -Type TXT -Server 1.1.1.1 ipconfig /flushdns
How do I look up DNS records on macOS?
macOS ships with dig, so you can query any record type from Terminal without installing anything. The system resolver keeps its own cache, so a change that dig already shows can still be invisible to Safari for a while. Flushing that cache takes two commands.
dig example.com TXT +short dig @1.1.1.1 example.com A +short sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
How do I look up DNS records on Linux?
On Linux, dig comes from the bind-utils package on Fedora and RHEL and the dnsutils package on Debian and Ubuntu. The host command from the same package gives a shorter answer. Systems that run systemd-resolved can also query through resolvectl, which shows which upstream resolver answered and lets you flush the local cache.
dig example.com A +short host -t MX example.com resolvectl query example.com resolvectl flush-caches