dns

Resolve a hostname over public DNS and return parsed records.

Resolve a hostname over public DNS and return parsed records. Query: host (required FQDN), types (comma-separated: A,AAAA,MX,TXT,NS,CAA,SRV,CNAME,PTR,SOA — default A,AAAA,MX,TXT,NS), resolver (cloudflare|google|quad9|opendns, optional). Returns one normalized JSON shape per record type with per-type error pass-through. Reserved/local TLDs (.local, .internal, .invalid, .test, localhost) are rejected. 4s per-query timeout.

get/api/dns/lookup

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/dns/lookup
  • Auth: API key in header PAYMENT-SIGNATURE

Query parameters

hoststring required

Hostname to look up.

typesstring

Types.

resolver'cloudflare' | 'google' | 'quad9' | 'opendns'

Resolver.

trial1

Try before you buy. Set to 1 for one free real call per endpoint per hour — no wallet or payment needed — to verify the endpoint before paying. Equivalent to sending the "X-2s-Trial: 1" request header. Listed only on operations that offer a trial; the others always answer 402.

Response

(unresolved $ref)

Changes

No recorded changes to this operation across all 1 revision of this API.