DNS Lookup
Query DNS records for any domain including A, AAAA, MX, TXT, NS, CNAME, and SOA records.
Authentication
All API requests require authentication using an API key. You can create an API key in your dashboard.
Include your API key in the Authorization header of your requests:
Authorization: Bearer your_api_key
Credit Usage
Each API call consumes credits from your account. This service costs 2 credits per call.
Endpoints
POST/api/v1/dns-lookup2 credits
Query DNS records for a specified domain
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
domain | string | Yes | The domain name to lookup (e.g., example.com) |
type | string | No | The DNS record type to query (A, AAAA, MX, TXT, NS, CNAME, SOA, or ALL). Defaults to ALL. |
Example Request
curl -X POST "https://api.goonlinetools.com/api/v1/dns-lookup" \ -H "Authorization: Bearer your_api_key" \ -H "Content-Type: application/json" \ -d '{"domain": "goonlinetools.com"}'
Example Response
{ "domain": "goonlinetools.com", "records": { "A": [ { "address": "172.67.212.113", "ttl": 300 }, { "address": "104.21.23.175", "ttl": 300 } ], "AAAA": [ { "address": "2606:4700:3037::ac43:d471", "ttl": 300 }, { "address": "2606:4700:3035::6815:17af", "ttl": 300 } ], "MX": [ { "exchange": "mx.zoho.com", "priority": 10 }, { "exchange": "mx2.zoho.com", "priority": 20 }, { "exchange": "mx3.zoho.com", "priority": 50 } ], "TXT": [ { "value": "6l3i9pjaeuu037cl2bqfjd15sd", "ttl": 0 }, { "value": "ft0svsf0pcakn2k6hi88v695lk", "ttl": 0 }, { "value": "google-site-verification=LWLsMMuuq1Y9HqM1o5tsj8jHI7yy78ICuxBlN0As88I", "ttl": 0 }, { "value": "s0mlrsa1usilpir0sljic1pc64", "ttl": 0 }, { "value": "v=spf1 include:zoho.com ~all", "ttl": 0 }, { "value": "yandex-verification: e6f925af06173a3b", "ttl": 0 }, { "value": "zoho-verification=zb15742487.zmverify.zoho.com", "ttl": 0 } ], "NS": [ { "value": "arya.ns.cloudflare.com", "ttl": 0 }, { "value": "hank.ns.cloudflare.com", "ttl": 0 } ], "SOA": { "nsname": "arya.ns.cloudflare.com", "hostmaster": "dns.cloudflare.com", "serial": 2369092649, "refresh": 10000, "retry": 2400, "expire": 604800, "minttl": 1800 } }, "timestamp": "2025-04-04T08:27:40.921Z" }
DNS Record Types
Record Type | Description |
---|---|
A | Maps a domain name to an IPv4 address |
AAAA | Maps a domain name to an IPv6 address |
MX | Specifies mail servers responsible for accepting email |
TXT | Text records often used for verification and security purposes |
NS | Nameserver records that delegate a domain to DNS servers |
CNAME | Canonical name records that alias one domain to another |
SOA | Start of Authority record containing administrative information |
Error Handling
The API uses standard HTTP status codes to indicate the success or failure of a request. Error responses include a JSON object with an error message.
{ "error": "Error message" }
Common Errors
Status Code | Error Message | Description |
---|---|---|
400 | Missing domain parameter | The domain parameter is required |
400 | Invalid domain format | The domain name format is invalid |
400 | Invalid record type | The specified DNS record type is not supported |
404 | No records found | No DNS records of the specified type were found |
429 | Too many requests | You've exceeded the rate limit for this API |
Implementation Notes
For performance reasons, DNS records are cached for a short period (typically 60 seconds) to reduce the load on DNS servers and provide faster responses for repeated queries.
Try Our APIs
Use our API Playground to test and explore our APIs. Make sure you are logged in to access this feature.