DNS Records
The DNS records endpoints let you browse the complete DNS history for any monitor with the DNS check enabled. We track changes to your DNS record types and alert you when anything changes.
You'll need a monitor ID for these endpoints.
Example request:
$ OHDEAR_TOKEN="your API token" $ curl https://ohdear.app/api/monitors/1/dns-history-items \ -H "Authorization: Bearer $OHDEAR_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json'
All endpoints below follow the same authentication pattern.
Get a specific DNS history item #
GET /api/monitors/{monitorId}/dns-history-items/{dnsHistoryItemId}
Returns a single DNS history item by its ID.
Here's what the response looks like:
{ "id": 2, "authoritative_nameservers": [ "ns1.openprovider.nl", "ns2.openprovider.be", "ns3.openprovider.eu" ], "dns_records": [ { "host": "freek.dev", "ttl": 1017, "class": "IN", "type": "A", "ip": "138.197.187.74" }, { "host": "freek.dev", "ttl": 4435, "class": "IN", "type": "MX", "pri": 10, "target": "aspmx.l.google.com" }, { "host": "freek.dev", "ttl": 1060, "class": "IN", "type": "TXT", "txt": "v=spf1 include:amazonses.com ..." }, "..." ], "raw_dns_records": { "ns1.openprovider.nl": [ "freek.dev.\t\t1017\tIN\tA\t138.197.187.74", "..." ], "..." }, "issues": [ { "name": "NameserversAreNotInSync", "nameservers": ["ns2.openprovider.be"] } ], "diff_summary": "No changes", "created_at": "2021-11-05 16:07:38" }
authoritative_nameservers: the nameservers we queried for your domaindns_records: parsed DNS records grouped by type. Each record includeshost,ttl,class,type, and type-specific fields (e.g.,ipfor A records,targetfor MX/NS,txtfor TXT)raw_dns_records: raw DNS responses from each nameserverissues: array of detected issues (see possible issues below)diff_summary: human-readable summary of changes compared to the previous checkcreated_at: when this check was performed (UTC)
Results are sorted in reverse chronological order -- the first item contains your current DNS records.
List DNS history #
GET /api/monitors/{monitorId}/dns-history-items
Returns a list of DNS history items for a monitor. Each item follows the same shape as the single response above.
Query parameters:
filter[created_at](string, optional) -- only return records created at or after this timestamp inYmdHisformat, in UTC (e.g.,20240615000000)
Possible issues #
The issues array can contain these issue types:
CouldNotDiscoverNameservers: we couldn't find the authoritative nameservers for your domainCouldNotFindAnyDnsRecords: some nameservers didn't return any records. The affected nameservers are listed in thenameserversproperty.NameserversAreNotInSync: a nameserver returned different records than the others. The out-of-sync nameservers are listed in thenameserversproperty.DnsLookupFailed: DNS lookup failed. The issue includes amessageand optionaldebuginformation.
Feel free to reach out via [email protected] or on X via @OhDearApp if you have any other questions. We'd love to help!