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

ParameterTypeRequiredDescription
domainstringYesThe domain name to lookup (e.g., example.com)
typestringNoThe 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 TypeDescription
AMaps a domain name to an IPv4 address
AAAAMaps a domain name to an IPv6 address
MXSpecifies mail servers responsible for accepting email
TXTText records often used for verification and security purposes
NSNameserver records that delegate a domain to DNS servers
CNAMECanonical name records that alias one domain to another
SOAStart 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 CodeError MessageDescription
400Missing domain parameterThe domain parameter is required
400Invalid domain formatThe domain name format is invalid
400Invalid record typeThe specified DNS record type is not supported
404No records foundNo DNS records of the specified type were found
429Too many requestsYou'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.