D
dns-csv.com
Back to lookup

DNS CSV API

Programmatic zone-style DNS inventory for agents and automation: apex, common hosts, and mail-auth names. Successful inventory records include TTL and provenance (configured or resolved). An invalid domain returns HTTP 200 with an ERROR row (type, hostname, value, isError) that omits ttl and provenance. One inventory request counts as one lookup against your monthly quota — one dig's worth of quota for the whole inventory, not one dig per record.

Agent recipe: migration audit

Audit a mail cutover with POST /api/dns/bulk. Each domain returns a zone-style inventory (MX, SPF, DMARC, and the fixed DKIM selector list, plus any hosts you add). Successful records include TTL and provenance; an invalid domain returns an ERROR row that omits them. Each fulfilled domain counts as one lookup, including a domain that returns only an ERROR row. A result with error lookup_failed does not count. Built-in DKIM probes only a static selector list (Google, Microsoft 365, and similar). Custom or per-identity selectors, including Amazon SES Easy DKIM, are not covered. A missing DKIM row is not proof that none exist. Pass known selectors in hosts as selector._domainkey. The sample hosts are outside the built-in probe list, so they add real queries.

# Migration audit: compare zone inventories before a mail cutover.
# Two domains cost two lookups (one inventory each, not one dig per record).
# relay and ses2024._domainkey are outside the built-in probe list.
# A missing DKIM row is not proof none exist; pass known selectors in hosts.
curl -X POST \
  -H "Authorization: Bearer dns_..." \
  -H "Content-Type: application/json" \
  -d '{"domains":["legacy.example.com","new.example.com"],"hosts":["relay","ses2024._domainkey"]}' \
  https://dns-csv.com/api/dns/bulk

Sample bulk response. Each domain is one inventory and one lookup.

{
  "count": 2,
  "type": "ALL",
  "results": [
    {
      "domain": "legacy.example.com",
      "records": [
        {
          "type": "MX",
          "hostname": "legacy.example.com",
          "value": "10 mail.legacy.example.com",
          "ttl": 300,
          "provenance": "configured"
        },
        {
          "type": "TXT",
          "hostname": "_dmarc.legacy.example.com",
          "value": "v=DMARC1; p=quarantine; rua=mailto:dmarc@legacy.example.com",
          "ttl": 300,
          "provenance": "configured"
        }
      ]
    },
    {
      "domain": "new.example.com",
      "records": [
        {
          "type": "MX",
          "hostname": "new.example.com",
          "value": "10 mail.new.example.com",
          "ttl": 3600,
          "provenance": "configured"
        },
        {
          "type": "A",
          "hostname": "new.example.com",
          "value": "203.0.113.10",
          "ttl": 300,
          "provenance": "resolved",
          "note": "Public A/AAAA may be synthesized from a panel ALIAS (not visible via DoH)"
        }
      ]
    }
  ],
  "meta": {
    "plan": "pro",
    "quotaUsed": 44,
    "quotaLimit": 1000
  }
}

Base URL

https://dns-csv.com/api

Authentication

All API requests require a Bearer token in the Authorization header. Generate your key from the Account page.

Authorization: Bearer dns_your_api_key_here

Endpoints

GET/api/dns

Returns one zone-style inventory for the domain (apex, common hosts, and mail-auth names), or filters that inventory to a single record type. The inventory counts as 1 lookup from your monthly quota.

Query Parameters

ParamRequiredDescription
domainyesDomain to query (e.g. example.com)
typenoFilter by record type: A, AAAA, CNAME, MX, NS, TXT, SOA, SRV, CAA, HTTPS. Omit for the full inventory.
hostsnoExtra hostnames to probe, comma-separated. Bare labels are qualified under domain. Names already on the built-in probe list add nothing. Pass a custom DKIM selector as selector._domainkey. At most 100 names.

Example

# Full inventory (1 lookup)
curl -H "Authorization: Bearer dns_..." \
"https://dns-csv.com/api/dns?domain=example.com"
# MX records only
curl -H "Authorization: Bearer dns_..." \
"https://dns-csv.com/api/dns?domain=example.com&type=MX"
POST/api/dns/bulk

Accepts an array of domains and returns one zone-style inventory for each. Each fulfilled domain counts as 1 lookup, including one that returns only an ERROR row. A result with error lookup_failed does not count. Bulk limits: Pro=10, Growth=50, Scale=100 domains per request. The migration audit recipe above is the multi-domain form.

Request Body (JSON)

{
"domains": ["example.com", "github.com"],
"type": "MX", // optional
"hosts": ["relay", "ses2024._domainkey"] // optional; outside the built-in probe list
}

Example

curl -X POST \
-H "Authorization: Bearer dns_..." \
-H "Content-Type: application/json" \
-d '{"domains":["example.com","github.com"]}' \
https://dns-csv.com/api/dns/bulk

Response Format

On a successful inventory record, ttl is the time-to-live in seconds. provenance is configured when the record is published at that name, or resolved when the address may be synthesized (for example a panel ALIAS rendered as A/AAAA). note is included only when the lookup adds one. An ERROR row for an invalid domain sets isError and omits ttl and provenance.

{
  "domain": "example.com",
  "type": "ALL",
  "count": 2,
  "records": [
    {
      "type": "MX",
      "hostname": "example.com",
      "value": "10 mail.example.com",
      "ttl": 300,
      "provenance": "configured"
    },
    {
      "type": "A",
      "hostname": "example.com",
      "value": "93.184.216.34",
      "ttl": 300,
      "provenance": "resolved",
      "note": "Public A/AAAA may be synthesized from a panel ALIAS (not visible via DoH)"
    }
  ],
  "meta": {
    "plan": "pro",
    "quotaUsed": 42,
    "quotaLimit": 1000
  }
}

Plans & Quotas

PlanPriceBrowser LookupsAPI Lookups/moBulk Limit
FreeFree1/day——
Pro$9.99/moUnlimited1,00010 domains
Growth$29.99/moUnlimited10,00050 domains
Scale$99.99/moUnlimited100,000100 domains

Error Codes

HTTPCodeMeaning
401missing_api_keyNo Authorization header provided
401invalid_api_keyKey is invalid or revoked
403plan_requiredAPI access requires Pro or higher
400missing_domaindomain query param is required
400invalid_typeUnsupported DNS record type
400too_many_domainsBulk domain count exceeds plan limit
400too_many_hostsMore than 100 custom hostnames
429rate_limitedToo many requests per minute (IP-based)
429quota_exceededMonthly API quota exhausted
502lookup_failedDNS resolver error or timeout

Ready to integrate?

Generate your API key from the Account page. Pro plan includes 1,000 API lookups/month.

Get your API key