The Advanced DNS Lookup API is a powerful tool designed for developers and network administrators to query DNS records with ease. It supports both forward lookups (by domain name) and reverse lookups (by IP address). The API handles a wide range of DNS record types, making it ideal for integration into web applications and network tools.
Choose the right plan for your DNS lookup needs with flexible pricing options and no hidden fees
1,000 Requests / Month
10,000 Requests / Month
50,000 Requests / Month
250,000 Requests / Month
Need a custom plan for high-volume usage? Contact us for enterprise pricing.
The Advanced DNS Lookup API is a powerful tool designed for developers and network administrators to query DNS records with ease. The API supports a wide range of DNS record types—including A, AAAA, MX, TXT, SOA, NS, and many others—and now also supports reverse DNS lookups using an IP address. It delivers clear JSON-formatted responses, making integration with web applications and network tools straightforward.
This documentation provides comprehensive details on how to integrate, query, and interpret responses from the DNS Lookup API for your network and domain management needs.
Click the button below to run and test this API with Postman:
You can also try the API with Zapier. Accepting this invitation gives you access to an early Beta version of DNS Lookup API Zapier, which is currently in development.
Build on Zapierhttps://advanced-dns-lookup-api.p.rapidapi.com
All API requests must be made over HTTPS. Requests over plain HTTP will fail. The API requires authentication via RapidAPI credentials in the request headers.
To authenticate your requests, include the following headers:
{
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
"X-RapidAPI-Host": "advanced-dns-lookup-api.p.rapidapi.com"
}
You can obtain your API key by subscribing to the DNS Lookup API on RapidAPI. Different subscription tiers offer varying request volumes.
Performs a DNS query for a specified domain name or a reverse DNS lookup if an IP address is provided.
Forward Lookup: Provide a name
parameter (and optionally a type
parameter) to retrieve DNS records for that domain.
Reverse Lookup: Provide an ip
parameter to perform a reverse DNS lookup (PTR). In this case, the name
parameter is optional. If both ip
and name
are provided, the API prioritizes the reverse lookup.
ip
(optional) - The IP address to perform a reverse DNS lookup.
name
(required for forward lookup) - The domain name to query.
type
(optional) - The DNS record type to query (e.g., A, AAAA, MX, TXT, etc.).
A
, AAAA
, TXT
, CNAME
, MX
, NS
, SOA
, SRV
, PTR
, HINFO
, MINFO
, RP
, AFSDB
, etc.
Accept
(header, optional) - Specifies that the client expects a JSON-formatted response.
application/json
Note:
- If no type
parameter is provided during a forward lookup, the API automatically performs DNS queries for the default record types: A, AAAA, MX, TXT, SOA, and NS. The results are grouped by record type.
- When an ip
parameter is provided, the API performs a reverse DNS lookup and returns PTR records in the same grouped format.
Example Request:
GET /v1/check?name=example.com&type=A HTTP/1.1
Accept: application/json
Example Response (HTTP 200):
{
"name": "example.com",
"records": {
"A": [
{
"name": "example.com",
"TTL": 300,
"data": "93.184.216.34"
}
]
}
}
Example Request:
GET /v1/check?name=example.com HTTP/1.1
Accept: application/json
Example Response (HTTP 200):
{
"name": "example.com",
"records": {
"A": [
{
"name": "example.com",
"TTL": 300,
"data": "93.184.216.34"
}
],
"AAAA": [
{
"name": "example.com",
"TTL": 300,
"data": "2606:2800:220:1:248:1893:25c8:1946"
}
],
"MX": [
{
"name": "example.com",
"TTL": 300,
"data": "10 mail.example.com."
}
],
"TXT": [
{
"name": "example.com",
"TTL": 300,
"data": "v=spf1 include:example.com -all"
}
],
"SOA": [
{
"name": "example.com",
"TTL": 300,
"data": "ns1.example.com. hostmaster.example.com. 2023010101 7200 3600 1209600 3600"
}
],
"NS": [
{
"name": "example.com",
"TTL": 300,
"data": "ns1.example.com."
}
]
}
}
Example Request:
GET /v1/check?ip=8.8.8.8 HTTP/1.1
Accept: application/json
Example Response (HTTP 200):
{
"ip": "8.8.8.8",
"records": {
"PTR": [
{
"name": "dns.google",
"TTL": 300,
"data": "dns.google"
}
]
}
}
Common error responses you might encounter:
400 Bad Request - Missing required parameter:
{
"error": "Missing required parameter 'name' for DNS lookup"
}
500 Internal Server Error - DNS lookup failure:
{
"error": "DNS lookup failed for record type A"
}
const axios = require('axios');
const options = {
method: 'GET',
url: 'https://advanced-dns-lookup-api.p.rapidapi.com/v1/check',
params: {name: 'example.com', type: 'A'},
headers: {
'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
'X-RapidAPI-Host': 'advanced-dns-lookup-api.p.rapidapi.com'
}
};
try {
const response = await axios.request(options);
console.log(response.data);
} catch (error) {
console.error(error);
}
import requests
url = "https://advanced-dns-lookup-api.p.rapidapi.com/v1/check"
querystring = {"name":"example.com","type":"A"}
headers = {
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
"X-RapidAPI-Host": "advanced-dns-lookup-api.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
curl --request GET \
--url 'https://advanced-dns-lookup-api.p.rapidapi.com/v1/check?name=example.com&type=A' \
--header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
--header 'X-RapidAPI-Host: advanced-dns-lookup-api.p.rapidapi.com'
TXT record data may be returned with additional quotation marks as part of their DNS encoding. You may choose to strip these quotes in your application if a cleaner presentation is desired.
The API supports querying various DNS record types. If you specify the type
parameter, only that record type will be returned. Otherwise, the API returns the default group of record types (A, AAAA, MX, TXT, SOA, and NS).
If both ip
and name
parameters are provided, the API prioritizes the reverse DNS lookup based on the ip
parameter.
The JSON-formatted responses are designed for seamless integration into web applications, network monitoring tools, and other systems requiring DNS lookup functionality.
The Advanced DNS Lookup API supports a wide range of DNS record types including A, AAAA, TXT, CNAME, MX, NS, SOA, SRV, PTR, HINFO, MINFO, RP, AFSDB, and more. If no specific type is requested, the API will return results for A, AAAA, MX, TXT, SOA, and NS records by default.
Yes, the API supports reverse DNS lookups using the ip
parameter. Simply provide an IP address to the endpoint, and the API will return the PTR records associated with that IP. If both ip
and name
parameters are provided, the API will prioritize the reverse lookup.
If you don't specify a record type using the type
parameter, the API will automatically perform queries for the default record types: A, AAAA, MX, TXT, SOA, and NS. The results will be grouped by record type in the response.
The API delivers responses in a clear JSON format, making it easy to integrate with any application. You'll need to sign up for an API key on RapidAPI, then make HTTP requests to the API endpoint with your required parameters. The JSON response can be parsed and used directly in your web applications, network tools, or any system requiring DNS lookup functionality.
The free Basic plan includes 1,000 requests per month. All plans have the same features and capabilities; they differ only in the number of allowed monthly requests. If you exceed your plan's limit, you'll need to upgrade to a higher tier or wait until the next billing cycle.
Connect our powerful APIs with your favorite platforms for seamless workflow automation
Create complex automation workflows
Microsoft's enterprise automation
Open-source workflow automation
Want to see us integrate with your favorite platform? Let us know!