# web.dns

Look up a host name's DNS records: addresses, mail servers, name servers, TXT, SOA and CAA.

DNS records, one of the Web scrapers.

| | |
| --- | --- |
| 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](https://docs.enrichednow.com/running-a-scraper.md); what a run costs is in [Usage and units](https://docs.enrichednow.com/usage-and-units.md).

## Inputs

The fields of `input`. A field that is not listed here is refused.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | yes | 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" | no | 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. |
| `mx[].priority` | integer | The server's preference: the lowest number is tried first. |
| `mx[].host` | 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. |
| `soa.primary` | string | The zone's primary name server. |
| `soa.contact` | string | The zone administrator's mailbox, as the SOA record writes it (a dot where an address has `@`). |
| `soa.serial` | integer | The zone's serial number. |
| `soa.refresh` | integer | Seconds between a secondary server's checks for a new serial. |
| `soa.retry` | integer | Seconds a secondary waits before it retries a failed check. |
| `soa.expire` | integer | Seconds after which a secondary that cannot reach the primary stops answering. |
| `soa.minimum` | integer | Seconds a resolver may remember that a name does not exist. |
| `caa` | array of object | Which certificate authorities may issue for the name. |
| `caa[].flags` | integer | The record's flags; 128 marks it critical. |
| `caa[].tag` | string | What the record governs: `issue`, `issuewild` or `iodef`. |
| `caa[].value` | 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). |
| `srv[].priority` | integer | The target's priority: the lowest number is tried first. |
| `srv[].weight` | integer | The target's share among those of equal priority. |
| `srv[].port` | integer | The port the service listens on. |
| `srv[].target` | string | The host that provides the service. |
| `records` | array of object | Every record that was returned, with its type and time to live. |
| `records[].type` | string | The record's type, e.g. `A` or `MX`. |
| `records[].ttl` | integer | Seconds the answer may be cached, as the resolver gave it (it counts down in a resolver's cache). |
| `records[].value` | 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

It starts a run with this scraper's example input and waits up to 60 seconds for it. The key is read from `ENRICHEDNOW_API_KEY`.

```bash
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"]}}'
```

## 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`.

```json
{
  "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.

```json
{
  "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](https://docs.enrichednow.com/results-and-statuses.md#reason-codes) lists every status and the reasons every scraper shares; [the reasons of the Web scrapers](https://docs.enrichednow.com/results-and-statuses.md#web) are in their own section there.
