DNS and Subdomains API

https://api.codepunch.com/dns/v2

DNS record lookups, nameserver mapping, subdomain enumeration, ccTLD domain search, and ASN data. This plan also includes all Domain Activity endpoints — see the Domain Activity docs for those.

Keyword syntax for domain and nameserver search: use | for OR, space for AND, double quotes for adjacent terms, * for partial matches, and ^ / $ for starts-with and ends-with. Each keyword must be at least 3 characters.

DNS Record Lookups

Separate endpoints for each record type, all following the same pattern:

GET/{token}/a/{fqdn}
GET/{token}/aaaa/{fqdn}
GET/{token}/cname/{fqdn}
GET/{token}/mx/{fqdn}
GET/{token}/ns/{fqdn}
GET/{token}/txt/{fqdn}
GET/{token}/ptr/{ip}
# A record lookup
GET .../a/dnlocker.com

{
  "status":      true,
  "hostname":    "dnlocker.com",
  "ip":          "157.245.209.181",
  "dns_records": [
    { "host": "dnlocker.com", "type": "A", "ttl": 198, "ip": "157.245.209.181" }
  ]
}

Nameservers

GET /{token}/nameservers

Search for nameservers by keyword, or look up the nameservers for a specific domain. Returns nameserver names and the count of gTLD domains hosted on each.

kw string optional

Keyword to search nameserver names by.

domain string optional

Find the nameservers for a specific domain. IDNs are supported. Use either kw or domain, not both.

GET /{token}/domains/{nameserver}

Returns gTLD domains hosted on a given nameserver. Supports advanced keyword filtering.

{
  "status":  true,
  "ns":      "ns1.softnik.com",
  "records": 2,
  "domains": ["freesoftwaretools.com", "keywordtools.com"]
}

ccTLD Domains

GET /{token}/cctlds

Search observed ccTLD domains by keyword. This is an experimental beta feature. Coverage is non-comprehensive.

tld string optional

Filter by registerable TLD. tld=uk returns .uk domains only. Use tld=co.uk for .co.uk specifically.

cc string optional

Two-letter country code. Returns all registerable TLDs under that country. cc=UK returns .uk, .co.uk, .net.uk, and others.

Subdomains

GET /{token}/subdomains/{domain}

Returns observed subdomains for a given domain derived from SSL/TLS certificate hostname data. Results are non-comprehensive as they depend on certificate issuance history.

{
  "status":  true,
  "domain":  "codepunch.com",
  "records": 19,
  "data": [
    "api.codepunch.com",
    "www.codepunch.com",
    "labs.codepunch.com"
  ]
}

ASN Lookup

GET /{token}/asn/{fqdn}

Returns the Autonomous System Number and AS Name for an IP address or FQDN.

{
  "status":      true,
  "hostname":    "dnlocker.com",
  "ip":          "157.245.209.181",
  "ip_asnumber": "AS14061",
  "ip_asname":   "DIGITALOCEAN-ASN, US"
}