DNS lookup and email security
The DNS API provides two self-operated read-only operations: live DNS record resolution across 8 core record types, and a structured email security audit with an A–F grade and prioritized risk diagnostics. You can also test both capabilities interactively without signing up on DNS Lookup and Email Security Check.
Prepare your project
Follow Set up your project and set ANTAPI_KEY in your terminal or backend. Check published routes, schemas, and prices in the DNS API reference, and confirm your balance and project budget before calling. A guide can be read before its API Reference is published.
Look up DNS records
curl "https://api.antapi.dev/dns/v1/lookup" \
--header "Authorization: Bearer $ANTAPI_KEY" \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: dns-lookup-example-001' \
--data '{"domain":"antapi.dev","types":["A","AAAA","MX","TXT","NS","CAA"]}'
domain accepts Unicode or ASCII Punycode domains (private suffixes such as .localhost or .internal and IP literals are rejected). types is optional and accepts any combination of A, AAAA, CNAME, MX, TXT, NS, SOA, and CAA; omitting types queries all 8 types concurrently.
Successful responses return the normalized data.records map, data.dnssec.authenticated_data (DNSSEC AD flag), and data.summary.status (ok, nxdomain, or partial).
Audit domain email security
curl "https://api.antapi.dev/dns/v1/email-security" \
--header "Authorization: Bearer $ANTAPI_KEY" \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: dns-email-sec-example-001' \
--data '{"domain":"antapi.dev","dkim_selectors":["google","default"]}'
domain is required. dkim_selectors is optional and probes up to 5 <selector>._domainkey.<domain> TXT records. The response evaluates mx, spf (including RFC 7208 DNS lookup count), dmarc, mta_sts, tls_rpt, bimi, and dkim, returning an overall data.summary.grade (A–F), data.summary.score (0–100), and prioritized data.summary.issues.
Billing and retries
Both operations are synchronous per_request calls. A completed resolution or audit (including a conclusive nxdomain answer) counts as one billable request. Invalid input (400), resolver timeouts (504), and total resolver failures (502) are not charged.
Both operations are idempotent. For an unchanged retry, reuse the original JSON body and Idempotency-Key. Save X-Request-ID and check usage and receipts when a result is uncertain. See Idempotency and retries.
Use through CLI
Use a CLI build that includes the dns commands. Follow CLI configuration to configure ANTAPI_API_KEY locally; the CLI uses that variable rather than the cURL example's ANTAPI_KEY.
antapi dns lookup antapi.dev --json
antapi dns lookup antapi.dev --types A,AAAA,MX,TXT --json
antapi dns email-security antapi.dev --dkim-selectors google,selector1 --json
Omit --types to query all eight record types. Omit --dkim-selectors to audit the other email configuration without guessing DKIM selectors. Both commands accept --idempotency-key; save and reuse it with unchanged arguments when recovering an uncertain request. Output preserves the public result and available request, receipt, and debit metadata. The CLI does not automatically retry or calculate fees.
Use through MCP
Follow MCP setup, authorize the dns:lookup and dns:email_security permissions, and discover dns_lookup and dns_email_security. Pass the JSON body fields inside input alongside a saved idempotency_key. Availability depends on the active Catalog release and granted OAuth scopes; existing MCP connections require new consent for newly added scopes.