DNS History API - Historical DNS Records with Dated Snapshots for Any Hostname
When a phishing domain drops its records or a migration goes wrong, the live DNS answer is already gone - a standard lookup cannot tell you what an A record pointed to last month. The DNS History API queries an archived database of DNS snapshots and returns every recorded state of a hostname's records, organized by the date each snapshot was taken. Each response covers eight record types - A, AAAA, MX, NS, SOA, SPF, TXT, and CNAME - with timestamps, TTLs, and the raw record text, paginated for deep histories. It is built for SOC analysts reconstructing incident timelines, threat intelligence teams tracking infrastructure pivots, and developers auditing configuration changes. Start with 10,000 free credits, no credit card required. For current records, use the DNS Lookup API.
What You Get in Every Response
Dated DNS Snapshots
Every response groups records into historicalDnsRecords, an array of snapshots each stamped with a queryTime date and the domainName queried. Within a snapshot, dnsRecordslists each record captured on that date, so consecutive snapshots show exactly when a value appeared, changed, or disappeared. Use it to reconstruct what a hostname's DNS looked like on a specific day - the core question in incident response and forensic work.
Eight Record Types, Filtered per Request
The type parameter accepts a comma-separated list of A, AAAA, MX, NS, SOA, SPF, TXT, and CNAME, or all for the complete set. The DNS History Lookup API returns only the types you request, so an email investigation can pull MX and SPF history without paging through years of A-record churn. Each snapshot also includes a dnsTypes count map showing how many records of each type it holds.
Raw and Parsed Record Detail
Every record carries its dnsType, ttl, and the original zone-file line in rawText, alongside parsed type-specific fields: address for A and AAAA, singleName for NS and CNAME, and full SOA structure (serial, refresh, retry, expire, minimum, host, admin). Responses return JSON by default or XML via the format parameter. Use the parsed fields for automated diffing and rawText when you need the record exactly as served.
Pagination Built for Deep Histories
Long-lived domains accumulate thousands of historical records. Responses report totalRecords, totalPages, and currentPage, and the page parameter walks the set with up to 100 unique records per page. Charges apply per page retrieved, so targeted type filters keep both payloads and credit spend proportional to the question you are answering.
Built for These Use Cases
Incident response timelines
When a breach or phishing campaign is under investigation, the first question is when the malicious domain started resolving to attacker infrastructure. Pull the domain's dated snapshots, locate the first appearance of the suspect address, and check whether nameservers changed mid-campaign - a common pivot technique. To find other domains that resolved to the same address during the attack window, continue with the Reverse DNS Lookup API.
Passive DNS enrichment pipelines
Threat intelligence platforms use the endpoint as a passive DNS API: feed indicator domains through it on a schedule and push the dated record history into SIEM or SOAR enrichment, so analysts see infrastructure changes alongside each alert without leaving their triage view.
Migration and configuration audits
After a hosting move or mail cutover, historical snapshots prove when records actually changed - settling disputes about propagation windows, verifying that decommissioned values no longer appear, and documenting configuration state for compliance reviews.
Domain due diligence
Before acquiring a domain, its DNS past matters: prior hosting associated with spam or malware damages deliverability and reputation long after the records change. Review the domain's record history alongside its ownership record from the WHOIS History API for a complete picture.
API Endpoint
$ pip install requestsimport requests
url = "https://api.apifreaks.com/v1.0/domain/dns/history?host-name=example.com&type=all&page=1"
payload = {}
headers = {
'X-apiKey': 'API-KEY'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
How to Guides
Look Up Specific Historical DNS Records
In an email-security investigation you rarely need a domain's full history - you need to know where mail was routed and which hosts it resolved to. Pass a comma-separated list in the type parameter to pull just those record types; use all only when the full set matters.
# Response { "totalRecords": 7, "totalPages": 1, "currentPage": 1, "historicalDnsRecords": [ { "queryTime": "2025-10-14", "domainName": "amazon.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "amazon.com", "type": 1, "dnsType": "A", "ttl": 900, "rawText": "amazon.com.\t\t900\tIN\tA\t54.239.28.85", "rRsetType": 1, "address": "54.239.28.85" }, { "name": "amazon.com", "type": 1, "dnsType": "A", "ttl": 900, "rawText": "amazon.com.\t\t900\tIN\tA\t52.94.236.248", "rRsetType": 1, "address": "52.94.236.248" }, { "name": "amazon.com", "type": 1, "dnsType": "A", "ttl": 900, "rawText": "amazon.com.\t\t900\tIN\tA\t205.251.242.103", "rRsetType": 1, "address": "205.251.242.103" } ] }, { "queryTime": "2026-07-14", "domainName": "amazon.com.", "dnsTypes": { "A": 1, "MX": 15 }, "dnsRecords": [ { "name": "amazon.com", "type": 1, "dnsType": "A", "ttl": 344, "rawText": "amazon.com.\t\t344\tIN\tA\t98.87.170.71", "rRsetType": 1, "address": "98.87.170.71" }, { "name": "amazon.com", "type": 1, "dnsType": "A", "ttl": 344, "rawText": "amazon.com.\t\t344\tIN\tA\t98.87.170.74", "rRsetType": 1, "address": "98.87.170.74" }, { "name": "amazon.com", "type": 1, "dnsType": "A", "ttl": 344, "rawText": "amazon.com.\t\t344\tIN\tA\t98.82.161.185", "rRsetType": 1, "address": "98.82.161.185" }, { "name": "amazon.com", "type": 15, "dnsType": "MX", "ttl": 900, "rawText": "amazon.com.\t\t900\tIN\tMX\t5 amazon-smtp.amazon.com.", "rRsetType": 15, "target": "amazon-smtp.amazon.com.", "priority": 5 } ] } ] }curl -X 'GET' 'https://api.apifreaks.com/v1.0/domain/dns/history?host-name=amazon.com&type=a%2Caaaa%2Cmx&apiKey=API-KEY'
Page Through a Long DNS History
Domains with decades of activity return more history than one response can hold. Read totalPages from the first response, then walk the page parameter until you reach it - each page holds up to 100 unique records. Omitting page returns page 1.
# Response { "totalRecords": 2706, "totalPages": 28, "currentPage": 2, "historicalDnsRecords": [ { "queryTime": "2025-05-30", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 82, "rawText": "google.com.\t\t82\tIN\tA\t142.251.36.46", "rRsetType": 1, "address": "142.251.36.46" } ] }, { "queryTime": "2024-09-20", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 53, "rawText": "google.com.\t\t53\tIN\tA\t142.251.36.14", "rRsetType": 1, "address": "142.251.36.14" } ] }, { "queryTime": "2024-09-23", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 165, "rawText": "google.com.\t\t165\tIN\tA\t142.251.39.110", "rRsetType": 1, "address": "142.251.39.110" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 82, "rawText": "google.com.\t\t82\tIN\tA\t142.250.179.174", "rRsetType": 1, "address": "142.250.179.174" } ] }, { "queryTime": "2024-08-12", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 265, "rawText": "google.com.\t\t265\tIN\tA\t142.250.179.174", "rRsetType": 1, "address": "142.250.179.174" } ] }, { "queryTime": "2024-03-21", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 106, "rawText": "google.com.\t\t106\tIN\tA\t108.177.122.101", "rRsetType": 1, "address": "108.177.122.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 106, "rawText": "google.com.\t\t106\tIN\tA\t108.177.122.113", "rRsetType": 1, "address": "108.177.122.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 106, "rawText": "google.com.\t\t106\tIN\tA\t108.177.122.138", "rRsetType": 1, "address": "108.177.122.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 106, "rawText": "google.com.\t\t106\tIN\tA\t108.177.122.139", "rRsetType": 1, "address": "108.177.122.139" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t142.251.15.102", "rRsetType": 1, "address": "142.251.15.102" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t142.251.15.101", "rRsetType": 1, "address": "142.251.15.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t142.251.15.139", "rRsetType": 1, "address": "142.251.15.139" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t142.251.15.138", "rRsetType": 1, "address": "142.251.15.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t142.251.15.113", "rRsetType": 1, "address": "142.251.15.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t142.251.15.100", "rRsetType": 1, "address": "142.251.15.100" } ] }, { "queryTime": "2024-09-03", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 16, "rawText": "google.com.\t\t16\tIN\tA\t142.251.36.14", "rRsetType": 1, "address": "142.251.36.14" } ] }, { "queryTime": "2024-09-26", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 162, "rawText": "google.com.\t\t162\tIN\tA\t142.251.36.46", "rRsetType": 1, "address": "142.251.36.46" } ] }, { "queryTime": "2024-09-04", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 138, "rawText": "google.com.\t\t138\tIN\tA\t142.251.39.110", "rRsetType": 1, "address": "142.251.39.110" } ] }, { "queryTime": "2024-06-07", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 110, "rawText": "google.com.\t\t110\tIN\tA\t172.217.168.238", "rRsetType": 1, "address": "172.217.168.238" } ] }, { "queryTime": "2024-04-04", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 150, "rawText": "google.com.\t\t150\tIN\tA\t64.233.185.113", "rRsetType": 1, "address": "64.233.185.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 134, "rawText": "google.com.\t\t134\tIN\tA\t74.125.136.113", "rRsetType": 1, "address": "74.125.136.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 134, "rawText": "google.com.\t\t134\tIN\tA\t74.125.136.101", "rRsetType": 1, "address": "74.125.136.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 134, "rawText": "google.com.\t\t134\tIN\tA\t74.125.136.100", "rRsetType": 1, "address": "74.125.136.100" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 150, "rawText": "google.com.\t\t150\tIN\tA\t64.233.185.102", "rRsetType": 1, "address": "64.233.185.102" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 134, "rawText": "google.com.\t\t134\tIN\tA\t74.125.136.139", "rRsetType": 1, "address": "74.125.136.139" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 150, "rawText": "google.com.\t\t150\tIN\tA\t64.233.185.138", "rRsetType": 1, "address": "64.233.185.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 134, "rawText": "google.com.\t\t134\tIN\tA\t74.125.136.102", "rRsetType": 1, "address": "74.125.136.102" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 134, "rawText": "google.com.\t\t134\tIN\tA\t74.125.136.138", "rRsetType": 1, "address": "74.125.136.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 150, "rawText": "google.com.\t\t150\tIN\tA\t64.233.185.100", "rRsetType": 1, "address": "64.233.185.100" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 150, "rawText": "google.com.\t\t150\tIN\tA\t64.233.185.101", "rRsetType": 1, "address": "64.233.185.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 150, "rawText": "google.com.\t\t150\tIN\tA\t64.233.185.139", "rRsetType": 1, "address": "64.233.185.139" } ] }, { "queryTime": "2025-01-26", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 241, "rawText": "google.com.\t\t241\tIN\tA\t142.250.179.142", "rRsetType": 1, "address": "142.250.179.142" } ] }, { "queryTime": "2024-08-08", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t142.251.39.110", "rRsetType": 1, "address": "142.251.39.110" } ] }, { "queryTime": "2024-10-29", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 103, "rawText": "google.com.\t\t103\tIN\tA\t142.250.179.174", "rRsetType": 1, "address": "142.250.179.174" } ] }, { "queryTime": "2024-12-09", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 122, "rawText": "google.com.\t\t122\tIN\tA\t142.251.39.110", "rRsetType": 1, "address": "142.251.39.110" } ] }, { "queryTime": "2025-07-28", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 63, "rawText": "google.com.\t\t63\tIN\tA\t108.177.119.113", "rRsetType": 1, "address": "108.177.119.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 63, "rawText": "google.com.\t\t63\tIN\tA\t108.177.119.102", "rRsetType": 1, "address": "108.177.119.102" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 63, "rawText": "google.com.\t\t63\tIN\tA\t108.177.119.138", "rRsetType": 1, "address": "108.177.119.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 63, "rawText": "google.com.\t\t63\tIN\tA\t108.177.119.101", "rRsetType": 1, "address": "108.177.119.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 63, "rawText": "google.com.\t\t63\tIN\tA\t108.177.119.139", "rRsetType": 1, "address": "108.177.119.139" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 63, "rawText": "google.com.\t\t63\tIN\tA\t108.177.119.100", "rRsetType": 1, "address": "108.177.119.100" } ] }, { "queryTime": "2024-10-02", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 145, "rawText": "google.com.\t\t145\tIN\tA\t142.251.39.110", "rRsetType": 1, "address": "142.251.39.110" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 256, "rawText": "google.com.\t\t256\tIN\tA\t142.250.179.174", "rRsetType": 1, "address": "142.250.179.174" } ] }, { "queryTime": "2026-02-22", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 71, "rawText": "google.com.\t\t71\tIN\tA\t142.250.102.138", "rRsetType": 1, "address": "142.250.102.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 71, "rawText": "google.com.\t\t71\tIN\tA\t142.250.102.102", "rRsetType": 1, "address": "142.250.102.102" } ] }, { "queryTime": "2026-05-13", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 266, "rawText": "google.com.\t\t266\tIN\tA\t142.250.27.102", "rRsetType": 1, "address": "142.250.27.102" } ] }, { "queryTime": "2025-12-15", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 69, "rawText": "google.com.\t\t69\tIN\tA\t142.250.27.139", "rRsetType": 1, "address": "142.250.27.139" } ] }, { "queryTime": "2025-01-21", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 107, "rawText": "google.com.\t\t107\tIN\tA\t142.250.179.174", "rRsetType": 1, "address": "142.250.179.174" } ] }, { "queryTime": "2024-03-30", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 11, "rawText": "google.com.\t\t11\tIN\tA\t173.194.219.139", "rRsetType": 1, "address": "173.194.219.139" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 204, "rawText": "google.com.\t\t204\tIN\tA\t74.125.138.139", "rRsetType": 1, "address": "74.125.138.139" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 218, "rawText": "google.com.\t\t218\tIN\tA\t64.233.176.101", "rRsetType": 1, "address": "64.233.176.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 218, "rawText": "google.com.\t\t218\tIN\tA\t64.233.176.139", "rRsetType": 1, "address": "64.233.176.139" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 218, "rawText": "google.com.\t\t218\tIN\tA\t64.233.176.113", "rRsetType": 1, "address": "64.233.176.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 204, "rawText": "google.com.\t\t204\tIN\tA\t74.125.138.100", "rRsetType": 1, "address": "74.125.138.100" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 11, "rawText": "google.com.\t\t11\tIN\tA\t173.194.219.101", "rRsetType": 1, "address": "173.194.219.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 204, "rawText": "google.com.\t\t204\tIN\tA\t74.125.138.101", "rRsetType": 1, "address": "74.125.138.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 11, "rawText": "google.com.\t\t11\tIN\tA\t173.194.219.102", "rRsetType": 1, "address": "173.194.219.102" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 218, "rawText": "google.com.\t\t218\tIN\tA\t64.233.176.138", "rRsetType": 1, "address": "64.233.176.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 11, "rawText": "google.com.\t\t11\tIN\tA\t173.194.219.100", "rRsetType": 1, "address": "173.194.219.100" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 113, "rawText": "google.com.\t\t113\tIN\tA\t74.125.136.139", "rRsetType": 1, "address": "74.125.136.139" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 113, "rawText": "google.com.\t\t113\tIN\tA\t74.125.136.138", "rRsetType": 1, "address": "74.125.136.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 113, "rawText": "google.com.\t\t113\tIN\tA\t74.125.136.113", "rRsetType": 1, "address": "74.125.136.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 204, "rawText": "google.com.\t\t204\tIN\tA\t74.125.138.113", "rRsetType": 1, "address": "74.125.138.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 11, "rawText": "google.com.\t\t11\tIN\tA\t173.194.219.138", "rRsetType": 1, "address": "173.194.219.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 113, "rawText": "google.com.\t\t113\tIN\tA\t74.125.136.102", "rRsetType": 1, "address": "74.125.136.102" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 11, "rawText": "google.com.\t\t11\tIN\tA\t173.194.219.113", "rRsetType": 1, "address": "173.194.219.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 218, "rawText": "google.com.\t\t218\tIN\tA\t64.233.176.102", "rRsetType": 1, "address": "64.233.176.102" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 113, "rawText": "google.com.\t\t113\tIN\tA\t74.125.136.100", "rRsetType": 1, "address": "74.125.136.100" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 204, "rawText": "google.com.\t\t204\tIN\tA\t74.125.138.138", "rRsetType": 1, "address": "74.125.138.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 218, "rawText": "google.com.\t\t218\tIN\tA\t64.233.176.100", "rRsetType": 1, "address": "64.233.176.100" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 113, "rawText": "google.com.\t\t113\tIN\tA\t74.125.136.101", "rRsetType": 1, "address": "74.125.136.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 204, "rawText": "google.com.\t\t204\tIN\tA\t74.125.138.102", "rRsetType": 1, "address": "74.125.138.102" } ] }, { "queryTime": "2024-08-27", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t142.251.36.46", "rRsetType": 1, "address": "142.251.36.46" } ] }, { "queryTime": "2024-08-06", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 75, "rawText": "google.com.\t\t75\tIN\tA\t142.251.39.110", "rRsetType": 1, "address": "142.251.39.110" } ] }, { "queryTime": "2024-08-07", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 233, "rawText": "google.com.\t\t233\tIN\tA\t142.250.179.174", "rRsetType": 1, "address": "142.250.179.174" } ] }, { "queryTime": "2024-04-25", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t172.253.63.139", "rRsetType": 1, "address": "172.253.63.139" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t172.253.63.100", "rRsetType": 1, "address": "172.253.63.100" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t172.253.63.113", "rRsetType": 1, "address": "172.253.63.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t172.253.63.138", "rRsetType": 1, "address": "172.253.63.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t172.253.63.101", "rRsetType": 1, "address": "172.253.63.101" } ] }, { "queryTime": "2024-01-10", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 72, "rawText": "google.com.\t\t72\tIN\tA\t172.217.215.101", "rRsetType": 1, "address": "172.217.215.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 72, "rawText": "google.com.\t\t72\tIN\tA\t172.217.215.138", "rRsetType": 1, "address": "172.217.215.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 72, "rawText": "google.com.\t\t72\tIN\tA\t172.217.215.139", "rRsetType": 1, "address": "172.217.215.139" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 72, "rawText": "google.com.\t\t72\tIN\tA\t172.217.215.113", "rRsetType": 1, "address": "172.217.215.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 72, "rawText": "google.com.\t\t72\tIN\tA\t172.217.215.100", "rRsetType": 1, "address": "172.217.215.100" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 72, "rawText": "google.com.\t\t72\tIN\tA\t172.217.215.102", "rRsetType": 1, "address": "172.217.215.102" } ] }, { "queryTime": "2024-08-19", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 261, "rawText": "google.com.\t\t261\tIN\tA\t142.251.39.110", "rRsetType": 1, "address": "142.251.39.110" } ] }, { "queryTime": "2024-01-05", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t74.125.138.113", "rRsetType": 1, "address": "74.125.138.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t74.125.138.100", "rRsetType": 1, "address": "74.125.138.100" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t74.125.138.102", "rRsetType": 1, "address": "74.125.138.102" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t74.125.138.138", "rRsetType": 1, "address": "74.125.138.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t74.125.138.101", "rRsetType": 1, "address": "74.125.138.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "google.com.\t\t300\tIN\tA\t74.125.138.139", "rRsetType": 1, "address": "74.125.138.139" } ] }, { "queryTime": "2024-10-10", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 28, "rawText": "google.com.\t\t28\tIN\tA\t142.251.39.110", "rRsetType": 1, "address": "142.251.39.110" } ] }, { "queryTime": "2026-05-04", "domainName": "google.com.", "dnsTypes": { "A": 1 }, "dnsRecords": [ { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 34, "rawText": "google.com.\t\t34\tIN\tA\t142.251.20.113", "rRsetType": 1, "address": "142.251.20.113" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 34, "rawText": "google.com.\t\t34\tIN\tA\t142.251.20.100", "rRsetType": 1, "address": "142.251.20.100" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 34, "rawText": "google.com.\t\t34\tIN\tA\t142.251.20.138", "rRsetType": 1, "address": "142.251.20.138" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 34, "rawText": "google.com.\t\t34\tIN\tA\t142.251.20.102", "rRsetType": 1, "address": "142.251.20.102" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 34, "rawText": "google.com.\t\t34\tIN\tA\t142.251.20.101", "rRsetType": 1, "address": "142.251.20.101" }, { "name": "google.com", "type": 1, "dnsType": "A", "ttl": 34, "rawText": "google.com.\t\t34\tIN\tA\t142.251.20.139", "rRsetType": 1, "address": "142.251.20.139" } ] } ] }curl -X 'GET' 'https://api.apifreaks.com/v1.0/domain/dns/history?host-name=google.com&type=all&page=2&apiKey=API-KEY'
Detect Unexpected DNS Changes on a Schedule
Catching a hijacked nameserver or an unauthorized MX change early depends on knowing what the records looked like before. Run a scheduled job that pulls the latest snapshot, compares its queryTime and record values against your known-good state, and alerts on any difference in NS or MX entries.
# Response { "totalRecords": 7, "totalPages": 1, "currentPage": 1, "historicalDnsRecords": [ { "queryTime": "2025-12-16", "domainName": "example.com.", "dnsTypes": { "NS": 2 }, "dnsRecords": [ { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 21600, "rawText": "example.com.\t21600\tIN\tNS\ta.iana-servers.net.", "rRsetType": 2, "singleName": "a.iana-servers.net." }, { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 21600, "rawText": "example.com.\t21600\tIN\tNS\tb.iana-servers.net.", "rRsetType": 2, "singleName": "b.iana-servers.net." } ] }, { "queryTime": "2025-12-17", "domainName": "example.com.", "dnsTypes": { "NS": 2 }, "dnsRecords": [ { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 128, "rawText": "example.com.\t128\tIN\tNS\ta.iana-servers.net.", "rRsetType": 2, "singleName": "a.iana-servers.net." }, { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 128, "rawText": "example.com.\t128\tIN\tNS\tb.iana-servers.net.", "rRsetType": 2, "singleName": "b.iana-servers.net." } ] }, { "queryTime": "2026-07-14", "domainName": "example.com.", "dnsTypes": { "MX": 15, "NS": 2 }, "dnsRecords": [ { "name": "example.com", "type": 15, "dnsType": "MX", "ttl": 21600, "rawText": "example.com.\t21600\tIN\tMX\t0 .", "rRsetType": 15, "target": ".", "priority": 0 }, { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 20464, "rawText": "example.com.\t20464\tIN\tNS\thera.ns.cloudflare.com.", "rRsetType": 2, "singleName": "hera.ns.cloudflare.com." }, { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 20464, "rawText": "example.com.\t20464\tIN\tNS\telliott.ns.cloudflare.com.", "rRsetType": 2, "singleName": "elliott.ns.cloudflare.com." } ] } ] }curl -X 'GET' \ 'https://api.apifreaks.com/v1.0/domain/dns/history?host-name=example.com&type=ns%2Cmx&apiKey=API-KEY'
Correlate DNS Changes with Ownership Changes
When a domain changes hands, its infrastructure usually follows - and mismatched timelines are a fraud signal. Pull the domain's WHOIS history from the WHOIS History API, note the registrant-change dates, then query the same domain here and check whether nameserver snapshots pivot around those dates.
# Response { "totalRecords": 6, "totalPages": 1, "currentPage": 1, "historicalDnsRecords": [ { "queryTime": "2025-12-16", "domainName": "example.com.", "dnsTypes": { "NS": 2 }, "dnsRecords": [ { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 21600, "rawText": "example.com.\t21600\tIN\tNS\ta.iana-servers.net.", "rRsetType": 2, "singleName": "a.iana-servers.net." }, { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 21600, "rawText": "example.com.\t21600\tIN\tNS\tb.iana-servers.net.", "rRsetType": 2, "singleName": "b.iana-servers.net." } ] }, { "queryTime": "2025-12-17", "domainName": "example.com.", "dnsTypes": { "NS": 2 }, "dnsRecords": [ { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 128, "rawText": "example.com.\t128\tIN\tNS\ta.iana-servers.net.", "rRsetType": 2, "singleName": "a.iana-servers.net." }, { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 128, "rawText": "example.com.\t128\tIN\tNS\tb.iana-servers.net.", "rRsetType": 2, "singleName": "b.iana-servers.net." } ] }, { "queryTime": "2026-07-14", "domainName": "example.com.", "dnsTypes": { "NS": 2 }, "dnsRecords": [ { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 20464, "rawText": "example.com.\t20464\tIN\tNS\thera.ns.cloudflare.com.", "rRsetType": 2, "singleName": "hera.ns.cloudflare.com." }, { "name": "example.com", "type": 2, "dnsType": "NS", "ttl": 20464, "rawText": "example.com.\t20464\tIN\tNS\telliott.ns.cloudflare.com.", "rRsetType": 2, "singleName": "elliott.ns.cloudflare.com." } ] } ] }curl -X 'GET' \ 'https://api.apifreaks.com/v1.0/domain/dns/history?host-name=example.com&type=ns&apiKey=API-KEY'
Frequently Asked Questions
totalRecords, totalPages, currentPage, and a historicalDnsRecords array of dated snapshots. Each snapshot carries its queryTime, a dnsTypes count map, and the full dnsRecords list for that date. A page holds up to 100 unique records.type parameter, or all to retrieve every supported type in a single request.host-name parameter accepts any hostname, so the DNS History Lookup API returns archived records for subdomains such as api.example.com as well as root domains.format=xml to receive the same structure as XML.Pricing
To use the DNS History API, API credits are required. Charges apply only for successful queries, defined by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any credits already charged will be refunded.
For each successful request, 10 credits will be charged to access the DNS History API. Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.