Skip to the content
EnrichedNowDocs

    Type to search every page.

    Menu

    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.

    Inputs of web.dns
    FieldTypeDescription
    domainrequiredstringThe 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.
    typesarray 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.

    Record fields of web.dns
    FieldTypeNotes
    domainstringThe host name that was looked up, in lower case (ASCII form for an internationalised name).
    existsbooleanFalse when the name does not exist in the DNS at all (NXDOMAIN).
    aarray of stringThe name's IPv4 addresses.
    aaaaarray of stringThe name's IPv6 addresses.
    cnamestring or nullThe name this one is an alias of; null when it is not an alias.
    mxarray of objectThe mail servers for the name, the most preferred first.
    priority (in mx[])integerThe server's preference: the lowest number is tried first.
    host (in mx[])stringThe mail server's host name, in lower case.
    nsarray of stringThe name servers of the zone, where the name is a zone's top.
    txtarray of stringThe name's TXT records, each as one string (SPF, site verifications and the like).
    soaobject or nullThe zone's start-of-authority record, where the name is a zone's top.
    primary (in soa)stringThe zone's primary name server.
    contact (in soa)stringThe zone administrator's mailbox, as the SOA record writes it (a dot where an address has @).
    serial (in soa)integerThe zone's serial number.
    refresh (in soa)integerSeconds between a secondary server's checks for a new serial.
    retry (in soa)integerSeconds a secondary waits before it retries a failed check.
    expire (in soa)integerSeconds after which a secondary that cannot reach the primary stops answering.
    minimum (in soa)integerSeconds a resolver may remember that a name does not exist.
    caaarray of objectWhich certificate authorities may issue for the name.
    flags (in caa[])integerThe record's flags; 128 marks it critical.
    tag (in caa[])stringWhat the record governs: issue, issuewild or iodef.
    value (in caa[])stringThe certificate authority allowed to issue, or the address violations are reported to.
    srvarray of objectThe name's SRV records (asked for only when types names SRV).
    priority (in srv[])integerThe target's priority: the lowest number is tried first.
    weight (in srv[])integerThe target's share among those of equal priority.
    port (in srv[])integerThe port the service listens on.
    target (in srv[])stringThe host that provides the service.
    recordsarray of objectEvery record that was returned, with its type and time to live.
    type (in records[])stringThe record's type, e.g. A or MX.
    ttl (in records[])integerSeconds the answer may be cached, as the resolver gave it (it counts down in a resolver's cache).
    value (in records[])stringThe record's data in zone-file form.
    types_askedarray of stringThe record types that were asked for.
    fetched_atstring (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:

    JSON
    {
      "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 lists every status and the reasons every scraper shares; the reasons of the Web scrapers are in their own section there.