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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
domain | string | Yes | A domain name, subdomains included; IDNs in Unicode or Punycode. | 1–253 characters |
Query parameters
| Field | Type | Required | Constraints |
|---|---|---|---|
type | string | No | One 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.
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
domain | string | Yes | ||
type | string | Yes | One of A, AAAA, CNAME, MX, TXT, NS, SRV, SOA | |
records | object[] | Yes | ||
records[].type | string | Yes | One of A, AAAA, CNAME, MX, TXT, NS, SRV, SOA | |
records[].data | string | Yes | The record data; MX is preference exchange, SRV is priority weight port target, SOA is mname rname. | |
resolved_at | string | Yes | Format 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
domaincan be a registered domain such asexample.comor a host name under it such aswww.github.com.typedefaults toA. Only records of the requested type are returned: a host that is an alias answers anAquery with its addresses, and itsCNAMErecord appears only when you ask forCNAME.datais the record's value as text: an address forAandAAAA, a host name forCNAMEandNS, the preference followed by the host forMX, such as10 mail.example.com.- A name with no records of that type returns an empty
recordsarray; that is not an error. - When the name servers answer with an error, the response is
502withupstream_error; when they do not answer in time,504withupstream_timeout. Both still count onednsunit.
Statuses
| Status | When | Headers |
|---|---|---|
200 | Records of the requested type | RateLimit-Policy, RateLimit |
400 | Invalid domain or record type | |
401 | Missing, invalid, revoked or expired API token | WWW-Authenticate |
403 | Your plan does not include the API; upgrade to Pro or above | |
429 | A quota window of your plan is spent; nothing was counted | RateLimit-Policy, RateLimit, Retry-After |
502 | The name servers answered with an error | |
504 | The name servers did not answer in time | |
| Other | Any other error |