DNS Lookup API - Find and Verify Real-Time DNS Records

Our DNS Lookup API offers instant and precise access to crucial DNS records, including A, AAAA, MX, NS, SOA, SPF, TXT, and CNAME, for any hostname. Designed for efficiency, this API simplifies DNS checks and helps you optimize network performance. Whether you are performing a DNS lookup to troubleshoot issues or manage domain configurations, our API provides the latest, most accurate data to ensure domain integrity and enhance your online security.

By leveraging our DNS Lookup API, network administrators, developers, and cybersecurity professionals can swiftly diagnose DNS problems, validate MX records, and refine domain settings. This API is an essential asset for anyone needing a reliable DNS checker, helping you maintain a robust and resilient online presence. With real-time DNS record verification and comprehensive lookup capabilities, our API supports effective domain management and advanced cybersecurity strategies.

10K Free Credits, No Credit Card Required

Features

Real-Time DNS Checker

Utilize our DNS checker API to obtain real-time DNS records efficiently. This feature enables you to execute live DNS lookups, swiftly identifying and addressing domain-related issues. By providing the most up-to-date and accurate DNS information, our API ensures that you maintain a reliable network infrastructure and effectively manage your domain settings.

Get Specific DNS Records Only

Efficiently retrieve only the DNS records you need with our targeted lookup capability. Choose from A, AAAA, MX, NS, SOA, SPF, TXT, and CNAME records to focus your analysis and optimize your domain management. This feature helps streamline your DNS checks by filtering out unnecessary data, enhancing your overall workflow and accuracy.

Documentation

API Endpoint

GET

https://api.apifreaks.com/v1.0/domain/dns/live

Test
LANGUAGE
Python
PHP
Java
Node
Ruby
$ pip install requests

API Request

ParameterRequiredTypeDefaultDescription
host-nameYesString
Hostname or URL whose DNS records required
typeYesArray
A comma-separated list of DNS record types for lookup is required. The values can be A, AAAA, MX, NS, SOA, SPF, TXT, CNAME, or all.

API Response

FieldTypeRequirementDescription
statusBooleanMandatory
Indicates whether the query was processed successfully (true or false).
queryTimeStringMandatory
Time at which the query was made. (Format: YYYY-MM-DD HH:mm:ss)
domainNameStringMandatory
Queried domain.
domainRegisteredBooleanMandatory
Indicates whether the domain is registered (true) or not (false).
dnsTypesObjectMandatory
DNS record types included in the response.
dnsRecordsList<Object>Mandatory
List of DNS records, with different formats depending on the record type.

A and AAAA DNS record object contains following fields:

FieldTypeRequirementDescription
nameStringMandatory
Name of the queried domain.
typeIntegerMandatory
DNS type (e.g., 1 for A, 28 for AAAA).
dnsTypeStringMandatory
DNS type as a string (e.g., "A", "AAAA").
ttlIntegerMandatory
Time to live.
rawTextStringMandatory
Raw (un-parsed) DNS record.
rRsetTypeIntegerMandatory
Indicates the resource record set type.
addressStringMandatory
IPV4 or IPV6 address for A or AAAA records respectively.

CNAME DNS record object contains following fields:

FieldTypeRequirementDescription
nameStringMandatory
Name of the queried domain.
typeIntegerMandatory
DNS type (e.g., 5 for CNAME).
dnsTypeStringMandatory
DNS type as a string (e.g., "CNAME").
ttlIntegerMandatory
Time to live.
rawTextStringMandatory
Raw (un-parsed) DNS record.
rRsetTypeIntegerMandatory
Indicates the resource record set type.
targetStringMandatory
Host to which this domain points.

MX DNS record object contains following fields:

FieldTypeRequirementDescription
nameStringMandatory
Name of the queried domain.
typeIntegerMandatory
DNS type (e.g., 15 for MX).
dnsTypeStringMandatory
DNS type as a string (e.g., "MX").
ttlIntegerMandatory
Time to live.
rawTextStringMandatory
Raw (un-parsed) DNS record.
rRsetTypeIntegerMandatory
Indicates the resource record set type.
targetStringMandatory
Targeted mail service provider.
priorityIntegerMandatory
Priority level associated with the mail server.

NS DNS record object contains following fields:

FieldTypeRequirementDescription
nameStringMandatory
Name of the queried domain.
typeIntegerMandatory
DNS type (e.g., 2 for NS).
dnsTypeStringMandatory
DNS type as a string (e.g., "NS").
ttlIntegerMandatory
Time to live.
rawTextStringMandatory
Raw (un-parsed) DNS record.
rRsetTypeIntegerMandatory
Indicates the resource record set type.
singleNameStringMandatory
Name server for that particular domain.

SOA DNS record object contains following fields:

FieldTypeRequirementDescription
nameStringMandatory
Name of the queried domain.
typeIntegerMandatory
DNS type (e.g., 6 for SOA).
dnsTypeStringMandatory
DNS type as a string (e.g., "SOA").
ttlIntegerMandatory
Time to live.
rawTextStringMandatory
Raw (un-parsed) DNS record.
rRsetTypeIntegerMandatory
Indicates the resource record set type.
adminStringMandatory
Administrative contact email for SOA records.
hostStringMandatory
Primary name server for SOA records.
expireStringMandatory
Expiry time for SOA records.
minimumIntegerMandatory
The minimum TTL for SOA records.
refreshIntegerMandatory
Indicates the refresh interval for SOA records.
retryIntegerMandatory
The retry interval for SOA records.
serialIntegerMandatory
The serial number for SOA records.

SPF and TXT DNS record object contains following fields:

FieldTypeRequirementDescription
nameStringMandatory
Name of the queried domain.
typeIntegerMandatory
DNS type (e.g., 16 for TXT).
dnsTypeStringMandatory
DNS type as a string (e.g., "TXT").
ttlIntegerMandatory
Time to live.
rawTextStringMandatory
Raw (un-parsed) DNS record.
rRsetTypeIntegerMandatory
Indicates the resource record set type.
stringsList<String>Mandatory
List containing the verification strings.

HTTP Error Codes

HTTP StatusReasons
400
Unable to process request.
404
Entered Domain does not exist: <HOSTNAME>
408
Unable to fetch dns records. Please try after some time. [For Technical Support email at: support@whoisfreaks.com]
500
Internal Server error occurred.
503
Service is unavailable.
504
Request is timed-out.

How to Guides

Lookup Specific Dns Records

To look up specific DNS records, including A, AAAA, MX, NS, SOA, SPF, TXT, and CNAME, include the type parameter in your request. Specify a comma-separated list of record types for targeted lookups, or use all to retrieve all supported DNS records in a single request.

# Get A, AAAA, and MX records only
curl --location 'https://api.apifreaks.com/v1.0/domain/dns/live?host-name=jfreaks.com&type=a%2Caaaa%2Cmx&apiKey=API-KEY'
{ "status": true, "queryTime": "2024-08-15 12:34:45", "domainName": "jfreaks.com", "domainRegistered": true, "dnsTypes": { "AAAA": 28, "A": 1, "MX": 15 }, "dnsRecords": [ { "name": "jfreaks.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "jfreaks.com. 300 IN A 172.67.193.56", "rRsetType": 1, "address": "172.67.193.56" }, { "name": "jfreaks.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "jfreaks.com. 300 IN A 104.21.20.167", "rRsetType": 1, "address": "104.21.20.167" }, { "name": "jfreaks.com", "type": 28, "dnsType": "AAAA", "ttl": 300, "rawText": "jfreaks.com. 300 IN AAAA 2606:4700:3032:0:0:0:ac43:c138", "rRsetType": 28, "address": "2606:4700:3032:0:0:0:ac43:c138" }, { "name": "jfreaks.com", "type": 28, "dnsType": "AAAA", "ttl": 300, "rawText": "jfreaks.com. 300 IN AAAA 2606:4700:3036:0:0:0:6815:14a7", "rRsetType": 28, "address": "2606:4700:3036:0:0:0:6815:14a7" }, { "name": "jfreaks.com", "type": 15, "dnsType": "MX", "ttl": 3600, "rawText": "jfreaks.com. 3600 IN MX 0 jfreaks-com.mail.protection.outlook.com.", "rRsetType": 15, "target": "jfreaks-com.mail.protection.outlook.com.", "priority": 0 } ] } # Get all supported DNS record types
curl --location 'https://api.apifreaks.com/v1.0/domain/dns/live?host-name=jfreaks.com&type=all&apiKey=API-KEY'
{ "status": true, "queryTime": "2024-08-15 12:36:20", "domainName": "jfreaks.com", "domainRegistered": true, "dnsTypes": { "A": 1, "AAAA": 28, "MX": 15, "NS": 2, "SOA": 6, "SPF": 99, "TXT": 16 }, "dnsRecords": [ { "name": "jfreaks.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "jfreaks.com. 300 IN A 172.67.193.56", "rRsetType": 1, "address": "172.67.193.56" }, { "name": "jfreaks.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "jfreaks.com. 300 IN A 104.21.20.167", "rRsetType": 1, "address": "104.21.20.167" }, { "name": "jfreaks.com", "type": 28, "dnsType": "AAAA", "ttl": 205, "rawText": "jfreaks.com. 205 IN AAAA 2606:4700:3032:0:0:0:ac43:c138", "rRsetType": 28, "address": "2606:4700:3032:0:0:0:ac43:c138" }, { "name": "jfreaks.com", "type": 28, "dnsType": "AAAA", "ttl": 205, "rawText": "jfreaks.com. 205 IN AAAA 2606:4700:3036:0:0:0:6815:14a7", "rRsetType": 28, "address": "2606:4700:3036:0:0:0:6815:14a7" }, { "name": "jfreaks.com", "type": 15, "dnsType": "MX", "ttl": 3600, "rawText": "jfreaks.com. 3600 IN MX 0 jfreaks-com.mail.protection.outlook.com.", "rRsetType": 15, "target": "jfreaks-com.mail.protection.outlook.com.", "priority": 0 }, { "name": "jfreaks.com", "type": 2, "dnsType": "NS", "ttl": 21600, "rawText": "jfreaks.com. 21600 IN NS cheryl.ns.cloudflare.com.", "rRsetType": 2, "singleName": "cheryl.ns.cloudflare.com." }, { "name": "jfreaks.com", "type": 2, "dnsType": "NS", "ttl": 21600, "rawText": "jfreaks.com. 21600 IN NS nash.ns.cloudflare.com.", "rRsetType": 2, "singleName": "nash.ns.cloudflare.com." }, { "name": "jfreaks.com", "type": 6, "dnsType": "SOA", "ttl": 1800, "rawText": "jfreaks.com. 1800 IN SOA cheryl.ns.cloudflare.com. dns.cloudflare.com. 2348954698 10000 2400 604800 1800", "rRsetType": 6, "admin": "dns.cloudflare.com.", "host": "cheryl.ns.cloudflare.com.", "expire": 604800, "minimum": 1800, "refresh": 10000, "retry": 2400, "serial": 2348954698 }, { "name": "jfreaks.com", "type": 99, "dnsType": "SPF", "ttl": 3600, "rawText": "jfreaks.com. 3600 IN SPF "v=spf1 include:zoho.com include:spf.protection.outlook.com ~all"", "rRsetType": 99, "strings": [ "v=spf1 include:zoho.com include:spf.protection.outlook.com ~all" ] }, { "name": "jfreaks.com", "type": 16, "dnsType": "TXT", "ttl": 3600, "rawText": "jfreaks.com. 3600 IN TXT "MS=ms84656090"", "rRsetType": 16, "strings": [ "MS=ms84656090" ] } ] }

FInd DNS Records By Hostname / URL

To retrieve DNS records for a specific hostname or URL, include the host-name parameter in your request with the desired hostname or URL value. Our API will automatically extract the hostname from the provided URL.

# Get DNS records for hostname
curl --location 'https://api.apifreaks.com/v1.0/domain/dns/live?host-name=jfreaks.com&type=all&apiKey=API-KEY'
{ "status": true, "queryTime": "2024-08-15 12:36:20", "domainName": "jfreaks.com", "domainRegistered": true, "dnsTypes": { "A": 1, "AAAA": 28, "MX": 15, "NS": 2, "SOA": 6, "SPF": 99, "TXT": 16 }, "dnsRecords": [ { "name": "jfreaks.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "jfreaks.com. 300 IN A 172.67.193.56", "rRsetType": 1, "address": "172.67.193.56" }, { "name": "jfreaks.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "jfreaks.com. 300 IN A 104.21.20.167", "rRsetType": 1, "address": "104.21.20.167" }, { "name": "jfreaks.com", "type": 28, "dnsType": "AAAA", "ttl": 205, "rawText": "jfreaks.com. 205 IN AAAA 2606:4700:3032:0:0:0:ac43:c138", "rRsetType": 28, "address": "2606:4700:3032:0:0:0:ac43:c138" }, { "name": "jfreaks.com", "type": 28, "dnsType": "AAAA", "ttl": 205, "rawText": "jfreaks.com. 205 IN AAAA 2606:4700:3036:0:0:0:6815:14a7", "rRsetType": 28, "address": "2606:4700:3036:0:0:0:6815:14a7" }, { "name": "jfreaks.com", "type": 15, "dnsType": "MX", "ttl": 3600, "rawText": "jfreaks.com. 3600 IN MX 0 jfreaks-com.mail.protection.outlook.com.", "rRsetType": 15, "target": "jfreaks-com.mail.protection.outlook.com.", "priority": 0 }, { "name": "jfreaks.com", "type": 2, "dnsType": "NS", "ttl": 21600, "rawText": "jfreaks.com. 21600 IN NS cheryl.ns.cloudflare.com.", "rRsetType": 2, "singleName": "cheryl.ns.cloudflare.com." }, { "name": "jfreaks.com", "type": 2, "dnsType": "NS", "ttl": 21600, "rawText": "jfreaks.com. 21600 IN NS nash.ns.cloudflare.com.", "rRsetType": 2, "singleName": "nash.ns.cloudflare.com." }, { "name": "jfreaks.com", "type": 6, "dnsType": "SOA", "ttl": 1800, "rawText": "jfreaks.com. 1800 IN SOA cheryl.ns.cloudflare.com. dns.cloudflare.com. 2348954698 10000 2400 604800 1800", "rRsetType": 6, "admin": "dns.cloudflare.com.", "host": "cheryl.ns.cloudflare.com.", "expire": 604800, "minimum": 1800, "refresh": 10000, "retry": 2400, "serial": 2348954698 }, { "name": "jfreaks.com", "type": 99, "dnsType": "SPF", "ttl": 3600, "rawText": "jfreaks.com. 3600 IN SPF "v=spf1 include:zoho.com include:spf.protection.outlook.com ~all"", "rRsetType": 99, "strings": [ "v=spf1 include:zoho.com include:spf.protection.outlook.com ~all" ] }, { "name": "jfreaks.com", "type": 16, "dnsType": "TXT", "ttl": 3600, "rawText": "jfreaks.com. 3600 IN TXT "MS=ms84656090"", "rRsetType": 16, "strings": [ "MS=ms84656090" ] } ] } # Get the DNS records for URL
curl --location 'https://api.apifreaks.com/v1.0/domain/dns/live?host-name=https%3A%2F%2Fjfreaks.com%2F&type=all&apiKey=API-KEY'
{ "status": true, "queryTime": "2024-08-15 12:43:52", "domainName": "https://jfreaks.com/", "domainRegistered": true, "dnsTypes": { "A": 1, "AAAA": 28, "MX": 15, "NS": 2, "SOA": 6, "TXT": 16, "SPF": 99 }, "dnsRecords": [ { "name": "jfreaks.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "jfreaks.com. 300 IN A 172.67.193.56", "rRsetType": 1, "address": "172.67.193.56" }, { "name": "jfreaks.com", "type": 1, "dnsType": "A", "ttl": 300, "rawText": "jfreaks.com. 300 IN A 104.21.20.167", "rRsetType": 1, "address": "104.21.20.167" }, { "name": "jfreaks.com", "type": 28, "dnsType": "AAAA", "ttl": 300, "rawText": "jfreaks.com. 300 IN AAAA 2606:4700:3032:0:0:0:ac43:c138", "rRsetType": 28, "address": "2606:4700:3032:0:0:0:ac43:c138" }, { "name": "jfreaks.com", "type": 28, "dnsType": "AAAA", "ttl": 300, "rawText": "jfreaks.com. 300 IN AAAA 2606:4700:3036:0:0:0:6815:14a7", "rRsetType": 28, "address": "2606:4700:3036:0:0:0:6815:14a7" }, { "name": "jfreaks.com", "type": 15, "dnsType": "MX", "ttl": 3600, "rawText": "jfreaks.com. 3600 IN MX 0 jfreaks-com.mail.protection.outlook.com.", "rRsetType": 15, "target": "jfreaks-com.mail.protection.outlook.com.", "priority": 0 }, { "name": "jfreaks.com", "type": 2, "dnsType": "NS", "ttl": 21600, "rawText": "jfreaks.com. 21600 IN NS cheryl.ns.cloudflare.com.", "rRsetType": 2, "singleName": "cheryl.ns.cloudflare.com." }, { "name": "jfreaks.com", "type": 2, "dnsType": "NS", "ttl": 21600, "rawText": "jfreaks.com. 21600 IN NS nash.ns.cloudflare.com.", "rRsetType": 2, "singleName": "nash.ns.cloudflare.com." }, { "name": "jfreaks.com", "type": 6, "dnsType": "SOA", "ttl": 1800, "rawText": "jfreaks.com. 1800 IN SOA cheryl.ns.cloudflare.com. dns.cloudflare.com. 2348954698 10000 2400 604800 1800", "rRsetType": 6, "admin": "dns.cloudflare.com.", "host": "cheryl.ns.cloudflare.com.", "expire": 604800, "minimum": 1800, "refresh": 10000, "retry": 2400, "serial": 2348954698 }, { "name": "jfreaks.com", "type": 16, "dnsType": "TXT", "ttl": 3600, "rawText": "jfreaks.com. 3600 IN TXT "MS=ms84656090"", "rRsetType": 16, "strings": [ "MS=ms84656090" ] }, { "name": "jfreaks.com", "type": 99, "dnsType": "SPF", "ttl": 3600, "rawText": "jfreaks.com. 3600 IN SPF "v=spf1 include:zoho.com include:spf.protection.outlook.com ~all"", "rRsetType": 99, "strings": [ "v=spf1 include:zoho.com include:spf.protection.outlook.com ~all" ] } ] }

Pricing

To use the DNS lookup API, API credits are required. Charges apply only for successful queries, indicated by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any credits previously charged will be refunded.

For each successful request, 15 credits will be charged for DNS lookup. 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.

Price Estimation Calculator