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 API

Utilize our DNS checker API to obtain real-time DNS records including A, AAAA, MX, NS, SOA, SPF, TXT, and CNAME, for any hostname. It 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

For a comprehensive view of the API response structure and detailed field descriptions, explore the interactive Response Table by clicking here.

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

MX Lookup API

Simply specify the record type as MX and provide the hostname. The MX Lookup API will instantly retrieve all associated MX records, making it ideal for verifying mail server configurations or troubleshooting email delivery issues.

Get MX Records only
curl --location 'https://api.apifreaks.com/v1.0/domain/dns/live?host-name=jfreaks.com&type=mx&apiKey=API-KEY'
{ "status": true, "queryTime": "2024-12-25 07:15:47", "domainName": "jfreaks.com", "domainRegistered": true, "dnsTypes": { "MX": 15 }, "dnsRecords": [ { "name": "jfreaks.com", "type": 15, "dnsType": "MX", "ttl": 3600, "rawText": "jfreaks.com.\t\t3600\tIN\tMX\t0 jfreaks-com.mail.protection.outlook.com.", "rRsetType": 15, "target": "jfreaks-com.mail.protection.outlook.com.", "priority": 0 } ] }

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