DNS Lookup API
Retrieve A, AAAA, MX, TXT, and other records to troubleshoot propagation issuesand verify configurations.
Integrate with your stack
import requests
url = "https://api.geekflare.com/dnsrecord"
payload = {"url": "example.com", "types": ["A", "MX"]}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Why Geekflare DNS API
Record Support
Query all major DNS record types including A, AAAA, CNAME, MX, TXT, NS, SOA, and CAA in a single request.
Email Security Verification
Validate email configuration by retrieving SPF, DKIM, and DMARC policies stored within TXT records.
Targeted Record Queries
Filter your request to retrieve specific record types (e.g., just MX or TXT) instead of fetching the entire DNS zone.
Real-Time Data
We query authoritative nameservers directly to ensure you get the latest data without stale caching issues.
JSON Output
Receive structured JSON responses that make it easy to integrate DNS data into your monitoring tools.
High Availability
Built on a redundant Google Cloud infra to ensure your DNS queries are resolved quickly.
Simple, transparent pricing
Build more with Geekflare
Frequently Asked Questions
No. We perform a live query at the time of your request to ensure you are seeing the current state of the DNS records.
A DNS lookup consumes 1 credit per request.
Yes, you can provide the full hostname (e.g., app.example.com or mail.example.com) to retrieve records specific to that subdomain.