DNS API

Description

Lookup the DNS records for any domain. The supported record types are: A, MX, NS, SOA, CNAME and TXT.

Endpoint

> GET https://api.jsonrepo.com/v1/knowledge/technology/dns

Headers

Field Description
api_key Required Your API Key

Parameters

Field Type Description
domain String Required The domain to examine
Format should be schemaless and clean
Example: youtube.com

Important Note:

Excessive and abusive usage of this endpoint will result in account suspension. Please act responsibly!

Domain Parameter Restrictions:

For more accurate matching, please only provide the actual domain name without any other URL components. Including a prefix like http://, a path suffix, or any other URL specific fragments could result in failed request due to inconsistent lookups.

Response

A successful request will result in a populated payload field with the expected output.

A failed request will result in an error output as detailed in Error Rules. If the endpoint validation fails due to missing, badly formatted or invalid parameters, the endpoint will return HTTP code 400 along with a message detailing the error.

See the examples section for more information.

Request

  • Curl
// Look up `youtube.com`

curl -G \
https://api.jsonrepo.com/v1/knowledge/technology/dns \
-H "api_key: {YOUR_API_KEY_HERE}" \
--data-urlencode "domain=youtube.com"

Success Response

{
    "http_code": 200,
    "http_message": "Ok",
    "message": "Successful execution",
    "payload": {
        "domain": {
            "hostname": "youtube.com",
            "records": {
                "A": [
                    {
                        "name": "youtube.com.",
                        "ttl": "300",
                        "type": "A",
                        "data": "216.58.207.238"
                    }
                ],
                "MX": [
                    {
                        "name": "youtube.com.",
                        "ttl": "300",
                        "type": "MX",
                        "data": "0 smtp.google.com."
                    }
                ],
                "NS": [
                    {
                        "name": "youtube.com.",
                        "ttl": "21600",
                        "type": "NS",
                        "data": "ns3.google.com."
                    },
                    {
                        "name": "youtube.com.",
                        "ttl": "21600",
                        "type": "NS",
                        "data": "ns4.google.com."
                    },
                    {
                        "name": "youtube.com.",
                        "ttl": "21600",
                        "type": "NS",
                        "data": "ns2.google.com."
                    },
                    {
                        "name": "youtube.com.",
                        "ttl": "21600",
                        "type": "NS",
                        "data": "ns1.google.com."
                    }
                ],
                "SOA": [
                    {
                        "name": "youtube.com.",
                        "ttl": "60",
                        "type": "SOA",
                        "data": "ns1.google.com. dns-admin.google.com. 669259768 900 900 1800 60"
                    }
                ],
                "CNAME": [],
                "TXT": [
                    {
                        "name": "youtube.com.",
                        "ttl": "3600",
                        "type": "TXT",
                        "data": "facebook-domain-verification=64jdes7le4h7e7lfpi22rijygx58j1"
                    },
                    {
                        "name": "youtube.com.",
                        "ttl": "3600",
                        "type": "TXT",
                        "data": "v=spf1 include:google.com mx -all"
                    },
                    {
                        "name": "youtube.com.",
                        "ttl": "3600",
                        "type": "TXT",
                        "data": "google-site-verification=QtQWEwHWM8tHiJ4s-jJWzEQrD_fF3luPnpzNDH-Nw-w"
                    }
                ]
            }
        }
    }
}

Error Response Examples

// Request with missing `domain` parameter

{
    "http_code": 400,
    "http_message": "Bad Request",
    "message": "Malformed request: `domain` parameter must be provided.",
    "payload": []
}