Skip to main content

DNS records

Looks up the DNS records of one type for a domain or a host name under it, as the DNS tool on namebeta.com does.

Request​

GET https://api.namebeta.com/v1/domains/{domain}/dns

Counts one dns unit; an invalid domain or record type counts none.

Requires an API token.

Path parameters

FieldTypeRequiredDescriptionConstraints
domainstringYesA domain name, subdomains included; IDNs in Unicode or Punycode.1–253 characters

Query parameters

FieldTypeRequiredConstraints
typestringNoOne of A, AAAA, CNAME, MX, TXT, NS, SRV, SOA; Default A
curl "https://api.namebeta.com/v1/domains/github.com/dns?type=MX" \
-H "Authorization: Bearer $NAMEBETA_API_TOKEN"

Response​

200: Records of the requested type.

FieldTypeRequiredDescriptionConstraints
domainstringYes
typestringYesOne of A, AAAA, CNAME, MX, TXT, NS, SRV, SOA
recordsobject[]Yes
records[].typestringYesOne of A, AAAA, CNAME, MX, TXT, NS, SRV, SOA
records[].datastringYesThe record data; MX is preference exchange, SRV is priority weight port target, SOA is mname rname.
resolved_atstringYesFormat date-time
{
"domain": "github.com",
"type": "MX",
"records": [
{ "type": "MX", "data": "0 github-com.mail.protection.outlook.com" }
],
"resolved_at": "2026-11-13T08:00:00.000Z"
}

Behavior​

  • domain can be a registered domain such as example.com or a host name under it such as www.github.com.
  • type defaults to A. Only records of the requested type are returned: a host that is an alias answers an A query with its addresses, and its CNAME record appears only when you ask for CNAME.
  • data is the record's value as text: an address for A and AAAA, a host name for CNAME and NS, the preference followed by the host for MX, such as 10 mail.example.com.
  • A name with no records of that type returns an empty records array; that is not an error.
  • When the name servers answer with an error, the response is 502 with upstream_error; when they do not answer in time, 504 with upstream_timeout. Both still count one dns unit.

Statuses​

StatusWhenHeaders
200Records of the requested typeRateLimit-Policy, RateLimit
400Invalid domain or record type
401Missing, invalid, revoked or expired API tokenWWW-Authenticate
403Your plan does not include the API; upgrade to Pro or above
429A quota window of your plan is spent; nothing was countedRateLimit-Policy, RateLimit, Retry-After
502The name servers answered with an error
504The name servers did not answer in time
OtherAny other error