Scraper APIWeb
web.dns
Look up a host name's DNS records: addresses, mail servers, name servers, TXT, SOA and CAA.
- Id
web.dns- Version
- 1
- Billed per
- request — 1 unit for a charged run
- Runs
- within one request
Start it with POST /v1/scrapers/web.dns/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.
Inputs
The fields of input. A field that is not listed here is refused.
| Field | Type | Description |
|---|---|---|
domainrequired | string | The host name to look up, e.g. example.com or mail.example.com. A web address is reduced to its host.Limit: at most 300 characters. |
types | array of "A" | "AAAA" | "CNAME" | "MX" | "NS" | "TXT" | "SOA" | "CAA" | "SRV" | The record types to ask for. All but SRV by default. |
Record fields
Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.
| Field | Type | Notes |
|---|---|---|
domain | string | The host name that was looked up, in lower case (ASCII form for an internationalised name). |
exists | boolean | False when the name does not exist in the DNS at all (NXDOMAIN). |
a | array of string | The name's IPv4 addresses. |
aaaa | array of string | The name's IPv6 addresses. |
cname | string or null | The name this one is an alias of; null when it is not an alias. |
mx | array of object | The mail servers for the name, the most preferred first. |
priority (in mx[]) | integer | The server's preference: the lowest number is tried first. |
host (in mx[]) | string | The mail server's host name, in lower case. |
ns | array of string | The name servers of the zone, where the name is a zone's top. |
txt | array of string | The name's TXT records, each as one string (SPF, site verifications and the like). |
soa | object or null | The zone's start-of-authority record, where the name is a zone's top. |
primary (in soa) | string | The zone's primary name server. |
contact (in soa) | string | The zone administrator's mailbox, as the SOA record writes it (a dot where an address has @). |
serial (in soa) | integer | The zone's serial number. |
refresh (in soa) | integer | Seconds between a secondary server's checks for a new serial. |
retry (in soa) | integer | Seconds a secondary waits before it retries a failed check. |
expire (in soa) | integer | Seconds after which a secondary that cannot reach the primary stops answering. |
minimum (in soa) | integer | Seconds a resolver may remember that a name does not exist. |
caa | array of object | Which certificate authorities may issue for the name. |
flags (in caa[]) | integer | The record's flags; 128 marks it critical. |
tag (in caa[]) | string | What the record governs: issue, issuewild or iodef. |
value (in caa[]) | string | The certificate authority allowed to issue, or the address violations are reported to. |
srv | array of object | The name's SRV records (asked for only when types names SRV). |
priority (in srv[]) | integer | The target's priority: the lowest number is tried first. |
weight (in srv[]) | integer | The target's share among those of equal priority. |
port (in srv[]) | integer | The port the service listens on. |
target (in srv[]) | string | The host that provides the service. |
records | array of object | Every record that was returned, with its type and time to live. |
type (in records[]) | string | The record's type, e.g. A or MX. |
ttl (in records[]) | integer | Seconds the answer may be cached, as the resolver gave it (it counts down in a resolver's cache). |
value (in records[]) | string | The record's data in zone-file form. |
types_asked | array of string | The record types that were asked for. |
fetched_at | string (date-time) | When the lookups ended, in UTC. |
Example request
# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/web.dns/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"domain":"wikipedia.org","types":["A","AAAA","CNAME","MX","NS","SOA","CAA"]}}'
# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start a run, wait for it to end, and get its records
result = client.scrape("web.dns", {
"domain": "wikipedia.org",
"types": ["A", "AAAA", "CNAME", "MX", "NS", "SOA", "CAA"],
})
print(result.run.id, result.run.status, result.run.record_count)
# Read its records: pages are fetched as you go
for record in result.records:
print(record)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("web.dns", {
domain: "wikipedia.org",
types: ["A", "AAAA", "CNAME", "MX", "NS", "SOA", "CAA"],
});
console.log(run.id, run.status, run.record_count);
// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Start a run, wait for it to end, and get its records
run, records, err := client.Scrape(ctx, "web.dns", map[string]any{"domain": "wikipedia.org", "types": []any{"A", "AAAA", "CNAME", "MX", "NS", "SOA", "CAA"}})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RecordCount)
// Read its records: pages are fetched as you go
for records.Next() {
fmt.Println(string(records.Current()))
}
if err := records.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.List;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
ScrapeResult result = client.scrape("web.dns", Map.of("domain", "wikipedia.org", "types", List.of("A", "AAAA", "CNAME", "MX", "NS", "SOA", "CAA")));
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
// Read its records: pages are fetched as you go
for (Map<String, Object> record : result.records()) {
System.out.println(record);
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow run web.dns --input-json '{"domain":"wikipedia.org","types":["A","AAAA","CNAME","MX","NS","SOA","CAA"]}'Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.
The body on its own:
{
"input": {
"domain": "wikipedia.org",
"types": [
"A",
"AAAA",
"CNAME",
"MX",
"NS",
"SOA",
"CAA"
]
}
}Example response
The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.
{
"id": "run_841742f37553189ff9c27ba1",
"scraper_id": "web.dns",
"scraper_version": 1,
"status": "ok",
"reason": null,
"input": {
"domain": "wikipedia.org",
"types": [
"A",
"AAAA",
"CNAME",
"MX",
"NS",
"SOA",
"CAA"
]
},
"record_count": 1,
"units": 1,
"units_per_request": 1,
"units_per_record": null,
"units_per_page": null,
"diagnostics": {
"requests": 1,
"bytes": 259214,
"wall_ms": 885,
"facts": {}
},
"created_at": "2026-11-16T22:37:50.170950Z",
"started_at": "2026-11-16T22:37:50.178331Z",
"finished_at": "2026-11-16T22:37:51.066313Z"
}Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.
{
"records": [
{
"domain": "wikipedia.org",
"exists": true,
"a": [
"103.102.166.224"
],
"aaaa": [
"2001:df2:e500:ed1a::1"
],
"cname": null,
"mx": [
{
"priority": 10,
"host": "mx-in1001.wikimedia.org"
},
{
"priority": 10,
"host": "mx-in2001.wikimedia.org"
}
],
"ns": [
"ns0.wikimedia.org",
"ns1.wikimedia.org",
"ns2.wikimedia.org"
],
"txt": [],
"soa": {
"primary": "ns0.wikimedia.org",
"contact": "hostmaster.wikimedia.org",
"serial": 2026111814,
"refresh": 43200,
"retry": 7200,
"expire": 1209600,
"minimum": 3600
},
"caa": [
{
"flags": 0,
"tag": "issue",
"value": "letsencrypt.org"
},
{
"flags": 0,
"tag": "issue",
"value": "pki.goog"
}
],
"srv": [],
"records": [
{
"type": "A",
"ttl": 180,
"value": "103.102.166.224"
},
{
"type": "AAAA",
"ttl": 156,
"value": "2001:df2:e500:ed1a::1"
}
],
"types_asked": [
"A",
"AAAA",
"CNAME"
],
"fetched_at": "2026-11-19T18:07:42.172407Z"
}
],
"next_cursor": null
}What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with … [truncated].
- Shortened:
records: 10 items, the first 2 shown. - Shortened:
types_asked: 7 items, the first 3 shown.
A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the Web scrapers are in their own section there.