DNS Lookup API: Get A, MX, TXT & More Records in JSON — Free Plan Available
Retrieve A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, DMARC, BIMI, MTA-STS, and TLSRPT for any domain through a single API call. All record types in one JSON response, authenticated with the same token as all WhoisJSON services.
Try the DNS Lookup API
Enter any domain to retrieve its full DNS record set in real time.
Every DNS Record Type in One Call
A single request to our NSLookup endpoint returns all available record types for the queried domain. No need for separate calls per record type.
Address Records
IPv4 and IPv6 addresses that a domain resolves to. The foundation of web hosting and service routing.
Mail Exchange
Mail server routing with priority values. Each entry includes an exchange hostname and a priority integer.
Text Records
SPF policies, DKIM public keys, domain ownership verification tokens, and other free-form key-value data.
Canonical Names
Domain aliases pointing to another hostname. Used for CDNs, subdomains, and service delegation. A dangling CNAME is a subdomain takeover vector.
Nameservers
Authoritative DNS servers for a zone. Essential for NS change detection and DNS infrastructure analysis.
Start of Authority
Zone metadata: primary nameserver, hostmaster email, serial number, and refresh/retry/expire timers.
CA Authorisation
Restricts which certificate authorities may issue SSL certs for the domain. Each record includes flags, tag (issue, issuewild, iodef), and value.
Most DNS APIs omit these types or expose them via separate endpoints. WhoisJSON returns all four automatically alongside standard records.
DMARC
Domain-based Message Authentication policy — defines reject/quarantine/none, rua/ruf reporting addresses, and alignment mode. Queried automatically from _dmarc.domain.
BIMI
Brand Indicators for Message Identification. Attaches a verified logo to authenticated emails. Requires DMARC p=quarantine or p=reject. Queried from default._bimi.domain.
MTA-STS
Mail Transfer Agent Strict Transport Security — signals that inbound SMTP connections must use TLS. Queried automatically from _mta-sts.domain.
TLSRPT
TLS Reporting — specifies where SMTP TLS failure reports should be sent. Queried automatically from _smtp._tls.domain.
What Developers Build with DNS Data
Email Configuration Verification
Validate MX records, SPF and DKIM TXT records, and DMARC policies programmatically. Ensure email deliverability before sending campaigns or onboarding new domains.
Security Monitoring & Threat Detection
Detect unauthorized DNS changes, identify DNS hijacking, and monitor nameserver modifications. Pair with our Domain Monitoring for continuous tracking and alerts.
DevOps & DNS Propagation Checks
Verify DNS propagation after deploying changes. Automate checks in your CI/CD pipeline to confirm that A records, CNAME aliases, and TXT verifications are live. Combine with SSL validation for full deployment verification.
Domain Research & Competitive Intelligence
Analyze hosting infrastructure, CDN usage, and email providers of any domain. Cross-reference DNS data with WHOIS registration details and availability status for complete domain intelligence.
One Endpoint, All Record Types
A single GET request returns every DNS record available for a domain. Same API key and authentication as all WhoisJSON endpoints.
Authentication: Authorization: TOKEN=YOUR_API_KEY
Response: JSON (default) or XML with format=xml
{
"A": ["142.250.185.14"],
"AAAA": ["2a00:1450:4007:80e::200e"],
"MX": [
{ "exchange": "smtp.google.com", "priority": 10 }
],
"NS": ["ns1.google.com", "ns2.google.com"],
"TXT": [
"v=spf1 include:_spf.google.com ~all",
"google-site-verification=..."
],
"CAA": [
{ "flags": 0, "tag": "issue", "value": "pki.goog" }
],
"SOA": {
"nsname": "ns1.google.com",
"hostmaster": "dns-admin.google.com",
"serial": 123456789,
"refresh": 900,
"retry": 900,
"expire": 1800,
"minttl": 60
},
"DMARC": ["v=DMARC1; p=reject; rua=mailto:[email protected]"],
"BIMI": [],
"MTASTS": ["v=STSv1; id=20250101000000Z"],
"TLSRPT": ["v=TLSRPTv1; rua=mailto:[email protected]"]
}
What Is a DNS Lookup API?
A DNS lookup API allows developers to query the Domain Name System programmatically. Instead of running command-line tools likenslookup ordig, you send an HTTP request and receive structured data in return. WhoisJSON's NSLookup API resolves all record types — A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, DMARC, BIMI, MTA-STS, and TLSRPT — in a single call, returning clean JSON that's ready for parsing, storage, and analysis. Average response time is under 200 milliseconds.
Part of the WhoisJSON Unified Platform
The DNS Lookup API is one of six endpoints available with every WhoisJSON account. The same API token also gives you access to WHOIS domain registration data, SSL certificate validation, real-time domain availability checks, subdomain discovery, and automated domain monitoring with alerts. No extra sign-ups, no extra keys — one token, six tools. Whether you are building an email verification system, a security scanner, or a domain management dashboard, all the data you need is accessible through a single, consistent API.
From Prototyping to Production
Every new account includes 1,000 free requests per month shared across all endpoints — enough for prototyping and small applications. Our paid plans scale to unlimited requests at up to 300 req/min with a 99.9% uptime SLA. Responses are cached for 3 hours by default; add force=1 to any request to bypass the cache. For common questions, check our FAQ or browse the full API documentation.
Frequently Asked Questions about the DNS Lookup API
_forceRefresh=1 to bypass the cache and get live DNS resolution — useful when checking propagation after a record change.Start Resolving DNS Records Today
Create your free account and query DNS data for any domain in seconds.