---
title: DNS History API - Historical DNS Records with Dated Snapshots for Any Hostname
version: 1.0.0
description: Retrieve historical DNS records for any hostname with dated snapshots. Each snapshot includes queryTime, domainName, dnsTypes, and dnsRecords fields showing the full DNS state at that point in time. Supported record types include A, AAAA, MX, NS, SOA, SPF, TXT, and CNAME records. Results are paginated with up to 100 unique records per page. Use the format parameter to receive responses in JSON or XML.
openapi: 3.1.1
servers:
  - https://api.apifreaks.com/v1.0
paths: 1
operations: 1
schemas: 5
---

## Table of Contents

- [DNS History API - Historical DNS Records with Dated Snapshots for Any Hostname v1.0.0](#dns-history-api-historical-dns-records-with-dated-snapshots-for-any-hostname-v100)
  - [Authentication](#authentication)
  - [DNS APIs](#dns-apis)
    - [dnsHistoryLookup](#dnshistorylookup)
      - [Parameters](#parameters)
      - [Responses](#responses)
  - [Schemas](#schemas)
    - [ErrorResponse](#errorresponse)
    - [DNSHistoryLookupResponse](#dnshistorylookupresponse)
    - [DnsHistoryRecord](#dnshistoryrecord)
    - [DnsTypes](#dnstypes)
    - [DnsRecord](#dnsrecord)



# DNS History API - Historical DNS Records with Dated Snapshots for Any Hostname v1.0.0

Retrieve historical DNS records for any hostname with dated snapshots. Each snapshot includes queryTime, domainName, dnsTypes, and dnsRecords fields showing the full DNS state at that point in time. Supported record types include A, AAAA, MX, NS, SOA, SPF, TXT, and CNAME records. Results are paginated with up to 100 unique records per page. Use the format parameter to receive responses in JSON or XML.

Base URLs:

* [https://api.apifreaks.com/v1.0](https://api.apifreaks.com/v1.0)

## Authentication

* API Key (ApiKeyAuthHeader)
    - Parameter Name: **X-apiKey**, in: header. Pass your API key via the X-apiKey request header.

* API Key (ApiKeyAuthQuery)
    - Parameter Name: **apiKey**, in: query. Pass your API key via the apiKey query parameter.

## DNS APIs

### dnsHistoryLookup

`GET /domain/dns/history`

*Get all historical A, AAAA, MX, NS, SOA, SPF, TXT, and CNAME DNS records of a hostname*

Retrieve historical DNS records for any hostname. Access unique historical data for A, AAAA, MX, NS, SOA, SPF, TXT, and CNAME records,
including subdomains. Results are paginated with up to 100 unique records per page.

#### Parameters

|Name|In|Type|Required|Description|
|---|---|---|---|---|
|format|query|string|false|Format of the response.|
|host-name|query|string|true|Hostname or URL whose historical DNS records are required|
|type|query|string|true|A comma-separated list of DNS record types for lookup.|
|page|query|integer|false|Page number for paginated results.|

##### Detailed descriptions

**type**: A comma-separated list of DNS record types for lookup.
Possible values: A, AAAA, MX, NS, SOA, SPF, TXT, CNAME, or all

##### Enumerated Values

|Parameter|Value|
|---|---|
|format|json|
|format|xml|
|type|A|
|type|AAAA|
|type|MX|
|type|NS|
|type|SOA|
|type|SPF|
|type|TXT|
|type|CNAME|
|type|all|

> Example responses

> Successful DNS history lookup response

```json
{
  "totalRecords": 46,
  "totalPages": 1,
  "currentPage": 1,
  "historicalDnsRecords": [
    {
      "queryTime": "2025-12-16",
      "domainName": "example.com.",
      "dnsTypes": {
        "SOA": 6,
        "AAAA": 28,
        "A": 1,
        "NS": 2
      },
      "dnsRecords": [
        {
          "name": "example.com",
          "type": 1,
          "dnsType": "A",
          "ttl": 4,
          "rawText": "example.com.\t\t4\tIN\tA\t23.192.228.84",
          "rRsetType": 1,
          "address": "23.192.228.84"
        },
        {
          "name": "example.com",
          "type": 1,
          "dnsType": "A",
          "ttl": 4,
          "rawText": "example.com.\t\t4\tIN\tA\t23.215.0.136",
          "rRsetType": 1,
          "address": "23.215.0.136"
        },
        {
          "name": "example.com",
          "type": 1,
          "dnsType": "A",
          "ttl": 278,
          "rawText": "example.com.\t\t278\tIN\tA\t23.220.75.245",
          "rRsetType": 1,
          "address": "23.220.75.245"
        },
        {
          "name": "example.com",
          "type": 1,
          "dnsType": "A",
          "ttl": 278,
          "rawText": "example.com.\t\t278\tIN\tA\t23.220.75.232",
          "rRsetType": 1,
          "address": "23.220.75.232"
        },
        {
          "name": "example.com",
          "type": 1,
          "dnsType": "A",
          "ttl": 4,
          "rawText": "example.com.\t\t4\tIN\tA\t23.215.0.138",
          "rRsetType": 1,
          "address": "23.215.0.138"
        },
        {
          "name": "example.com",
          "type": 1,
          "dnsType": "A",
          "ttl": 4,
          "rawText": "example.com.\t\t4\tIN\tA\t23.192.228.80",
          "rRsetType": 1,
          "address": "23.192.228.80"
        },
        {
          "name": "example.com",
          "type": 28,
          "dnsType": "AAAA",
          "ttl": 89,
          "rawText": "example.com.\t\t89\tIN\tAAAA\t2600:1406:5e00:6:0:0:17ce:bc12",
          "rRsetType": 28,
          "address": "2600:1406:5e00:6:0:0:17ce:bc12"
        },
        {
          "name": "example.com",
          "type": 28,
          "dnsType": "AAAA",
          "ttl": 202,
          "rawText": "example.com.\t\t202\tIN\tAAAA\t2600:1406:bc00:53:0:0:b81e:94ce",
          "rRsetType": 28,
          "address": "2600:1406:bc00:53:0:0:b81e:94ce"
        },
        {
          "name": "example.com",
          "type": 28,
          "dnsType": "AAAA",
          "ttl": 89,
          "rawText": "example.com.\t\t89\tIN\tAAAA\t2600:1406:5e00:6:0:0:17ce:bc1b",
          "rRsetType": 28,
          "address": "2600:1406:5e00:6:0:0:17ce:bc1b"
        },
        {
          "name": "example.com",
          "type": 28,
          "dnsType": "AAAA",
          "ttl": 202,
          "rawText": "example.com.\t\t202\tIN\tAAAA\t2600:1408:ec00:36:0:0:1736:7f31",
          "rRsetType": 28,
          "address": "2600:1408:ec00:36:0:0:1736:7f31"
        },
        {
          "name": "example.com",
          "type": 28,
          "dnsType": "AAAA",
          "ttl": 202,
          "rawText": "example.com.\t\t202\tIN\tAAAA\t2600:1408:ec00:36:0:0:1736:7f24",
          "rRsetType": 28,
          "address": "2600:1408:ec00:36:0:0:1736:7f24"
        },
        {
          "name": "example.com",
          "type": 28,
          "dnsType": "AAAA",
          "ttl": 202,
          "rawText": "example.com.\t\t202\tIN\tAAAA\t2600:1406:bc00:53:0:0:b81e:94c8",
          "rRsetType": 28,
          "address": "2600:1406:bc00:53:0:0:b81e:94c8"
        },
        {
          "name": "example.com",
          "type": 6,
          "dnsType": "SOA",
          "ttl": 3600,
          "rawText": "example.com.\t\t3600\tIN\tSOA\tns.icann.org. noc.dns.icann.org. 2022091323 7200 3600 1209600 3600",
          "rRsetType": 6,
          "admin": "noc.dns.icann.org.",
          "host": "ns.icann.org.",
          "expire": 1209600,
          "minimum": 3600,
          "refresh": 7200,
          "retry": 3600,
          "serial": 2022091323
        },
        {
          "name": "example.com",
          "type": 2,
          "dnsType": "NS",
          "ttl": 21600,
          "rawText": "example.com.\t\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.\t\t21600\tIN\tNS\tb.iana-servers.net.",
          "rRsetType": 2,
          "singleName": "b.iana-servers.net."
        }
      ]
    },
    {
      "queryTime": "2025-12-17",
      "domainName": "example.com.",
      "dnsTypes": {
        "AAAA": 28,
        "A": 1,
        "NS": 2
      },
      "dnsRecords": [
        {
          "name": "example.com",
          "type": 1,
          "dnsType": "A",
          "ttl": 300,
          "rawText": "example.com.\t\t300\tIN\tA\t104.20.34.220",
          "rRsetType": 1,
          "address": "104.20.34.220"
        },
        {
          "name": "example.com",
          "type": 1,
          "dnsType": "A",
          "ttl": 300,
          "rawText": "example.com.\t\t300\tIN\tA\t172.66.144.113",
          "rRsetType": 1,
          "address": "172.66.144.113"
        },
        {
          "name": "example.com",
          "type": 28,
          "dnsType": "AAAA",
          "ttl": 300,
          "rawText": "example.com.\t\t300\tIN\tAAAA\t2606:4700:10:0:0:0:ac42:9071",
          "rRsetType": 28,
          "address": "2606:4700:10:0:0:0:ac42:9071"
        },
        {
          "name": "example.com",
          "type": 28,
          "dnsType": "AAAA",
          "ttl": 300,
          "rawText": "example.com.\t\t300\tIN\tAAAA\t2606:4700:10:0:0:0:6814:22dc",
          "rRsetType": 28,
          "address": "2606:4700:10:0:0:0:6814:22dc"
        },
        {
          "name": "example.com",
          "type": 2,
          "dnsType": "NS",
          "ttl": 128,
          "rawText": "example.com.\t\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.\t\t128\tIN\tNS\tb.iana-servers.net.",
          "rRsetType": 2,
          "singleName": "b.iana-servers.net."
        }
      ]
    }
  ]
}
```

> Bad Request — Invalid DNS type or malformed hostname

```json
{
  "timestamp": "2026-07-23T09:52:28.093Z",
  "status": 400,
  "error": "Invalid Param Exception",
  "message": "Please provide correct dns records type(s) [For Technical Support: support@whoisfreaks.com]",
  "path": "/v2.0/dns/historical"
}
```

```json
{
  "timestamp": "2026-07-23T09:54:17.353Z",
  "status": 400,
  "error": "Invalid Param Exception",
  "message": "Please pass domain param correct value[For Technical Support: support@whoisfreaks.com]",
  "path": "/v2.0/dns/historical"
}
```

> Not Found — No DNS history records for the hostname

```json
{
  "timestamp": "2026-07-23T09:52:28.643Z",
  "status": 404,
  "error": "Record not Found",
  "message": "No Record Found across: zzsuperrandomnonexistent998877.com",
  "path": "/v2.0/dns/historical"
}
```

#### Responses

|Status|Meaning|Description|Schema|
|---|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful DNS history lookup response|[DNSHistoryLookupResponse](#dnshistorylookupresponse)|
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request — Invalid DNS type or malformed hostname|[ErrorResponse](#errorresponse)|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found — No DNS history records for the hostname|[ErrorResponse](#errorresponse)|

#### Response Headers

|Status|Header|Type|Format|Description|
|---|---|---|---|---|
|200|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|400|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|404|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|

To perform this operation, you must be authenticated by means of one of the following methods:
ApiKeyAuthHeader, ApiKeyAuthQuery

## Schemas

### ErrorResponse

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|error|string|false|none|Short error category or exception type.|
|message|string|true|none|Human-readable error message describing the failure.|
|path|string|false|none|API endpoint path that produced the error.|
|status|integer|false|none|HTTP status code returned with the error.|
|timestamp|string(date-time)|false|none|Timestamp when the error occurred (ISO 8601).|

### DNSHistoryLookupResponse

Paginated collection of historical DNS snapshots for the requested hostname.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|totalPages|integer|true|none|Total number of pages available.|
|currentPage|integer|true|none|Current page number returned.|
|totalRecords|integer|true|none|Total number of unique DNS records found.|
|historicalDnsRecords|[[DnsHistoryRecord](#dnshistoryrecord)]|true|none|Array of dated DNS snapshots.|

### DnsHistoryRecord

A single dated DNS snapshot for the queried hostname.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|queryTime|string|true|none|Date when the DNS snapshot was taken. (Format: YYYY-MM-DD)|
|domainName|string|true|none|Queried domain name with trailing dot.|
|dnsTypes|[DnsTypes](#dnstypes)|true|none|Map of each DNS record type present in dnsRecords to its IANA DNS resource record type code (e.g. A: 1, AAAA: 28, MX: 15, NS: 2, SOA: 6, TXT: 16, SPF: 99). Indicates which record types were found in this snapshot, not how many of each — count entries in dnsRecords for that.|
|dnsRecords|[[DnsRecord](#dnsrecord)]|true|none|Array of DNS records for this snapshot. Field presence varies by dnsType — see DnsRecord for which fields apply to which type.|

### DnsTypes

Map of each DNS record type present in dnsRecords to its IANA DNS resource record type code (e.g. A: 1, AAAA: 28, MX: 15, NS: 2, SOA: 6, TXT: 16, SPF: 99). Indicates which record types were found in this snapshot, not how many of each — count entries in dnsRecords for that.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|DnsTypeCode|integer|false|none|IANA DNS resource record type code for this DNS record type (A: 1, AAAA: 28, CNAME: 5, MX: 15, NS: 2, SOA: 6, TXT: 16, SPF: 99).|

### DnsRecord

A single DNS resource record. name, type, dnsType, ttl, rawText, and rRsetType are always present; every other field is populated only for the dnsType(s) noted in its description.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|name|string|true|none|Name of the queried domain.|
|type|integer|true|none|DNS type code (1=A, 28=AAAA, 5=CNAME, 15=MX, 2=NS, 6=SOA, 16=TXT, 99=SPF).|
|dnsType|string|true|none|DNS record type as a string.|
|ttl|integer|true|none|Time to live in seconds.|
|rawText|string|true|none|Raw (un-parsed) DNS record text.|
|rRsetType|integer|true|none|Resource record set type code.|
|address|string|false|none|IPv4 or IPv6 address. Present only when dnsType is A or AAAA.|
|target|string|false|none|Target hostname. Present only when dnsType is CNAME or MX.|
|priority|integer|false|none|Mail server priority. Present only when dnsType is MX.|
|singleName|string|false|none|Authoritative name server. Present only when dnsType is NS.|
|admin|string|false|none|Administrative contact email. Present only when dnsType is SOA.|
|host|string|false|none|Primary name server. Present only when dnsType is SOA.|
|expire|integer|false|none|Expiry time in seconds. Present only when dnsType is SOA.|
|minimum|integer|false|none|Minimum TTL in seconds. Present only when dnsType is SOA.|
|refresh|integer|false|none|Refresh interval in seconds. Present only when dnsType is SOA.|
|retry|integer|false|none|Retry interval in seconds. Present only when dnsType is SOA.|
|serial|integer|false|none|Serial number. Present only when dnsType is SOA.|
|strings|[string]|false|none|Verification or policy strings. Present only when dnsType is TXT or SPF.|

##### Enumerated Values

|Property|Value|
|---|---|
|dnsType|A|
|dnsType|AAAA|
|dnsType|CNAME|
|dnsType|MX|
|dnsType|NS|
|dnsType|SOA|
|dnsType|TXT|
|dnsType|SPF|
