Skip to content

DNS lookup API for every record a domain publishes

Send a domain and get its A, AAAA, CNAME, MX, TXT, NS, SOA and CAA records, plus the mail provider and DNS host behind them. Send an IP instead and you get reverse DNS. Every lookup is 2 credits.

2 creditsIntelligenceCSV bulkMCP
POST/v1/dns-lookup
{
  "success": true,
  "data": {
    "query": "example.com",
    "query_type": "domain",
    "records": {
      "a": [
        {
          "address": "203.0.113.10",
          "ttl": 300
        }
      ],
      "aaaa": [
        {
          "address": "2001:db8::10",
          "ttl": 300
        }
      ],
      "cname": [],
      "mx": [
        {
          "priority": 10,
          "exchange": "mx1.mailhost.example",
          "ttl": 3600
        },
        {
          "priority": 20,
          "exchange": "mx2.mailhost.example",
          "ttl": 3600
        }
      ],
      "txt": [
        "v=spf1 include:_spf.mailhost.example ~all",
        "example-site-verification=4f9c2a71d0b84e53"
      ],
      "ns": [
        "ns1.dnshost.example",
        "ns2.dnshost.example"
      ],
      "soa": {
        "primary_ns": "ns1.dnshost.example",
        "admin_email": "hostmaster@example.com",
        "serial": 2026111201,
        "refresh": 7200,
        "retry": 3600,
        "expire": 1209600,
        "minimum_ttl": 300
      },
      "caa": [
        {
          "flags": 0,
          "tag": "issue",
          "value": "ca.example"
        }
      ],
      "ptr": []
    },
    "mail_provider": "Example Mail Hosting",
    "dns_host": "Example DNS Host"
  },
  "meta": {
    "credits_used": 2,
    "credits_remaining": 999,
    "cached": false,
    "request_id": "req_8f3a2c1e9b7d"
  }
}
[01/Response]

What you get back

The fields most teams branch on. The full response is in the sample on this page and in the API reference.

records.aA recordsIPv4 addresses the name resolves to, each with a TTL. IPv6 addresses sit beside them in records.aaaa.
records.mxMX recordsMail servers for the domain, in priority order.
records.txtTXT recordsEvery TXT string, including SPF policies and site verification tokens.
records.nsNameserversThe authoritative nameservers the domain is delegated to.
records.caaCAA recordsWhich certificate authorities the domain allows to issue certificates for it.
mail_providerMail providerThe email service inferred from the MX hosts, or null when none is recognized.
dns_hostDNS hostThe DNS service inferred from the nameservers.
records.ptrPTR (reverse DNS)Hostnames an IP address points back to. Filled when you send an IP instead of a domain.
[02/Capabilities]

What DNS Lookup does

01

Eight record types in one response

A single request returns A, AAAA, CNAME, MX, TXT, NS, SOA and CAA records as structured JSON with TTLs. You do not run eight separate queries and parse text output.

02

Mail provider and DNS host detection

MX and NS hostnames are matched to the service behind them, so a named mail provider and DNS host come back next to the raw records. That answers which email platform a company runs on without reading MX hostnames yourself.

03

Reverse DNS for IP addresses

Put an IP address in the domain field and the lookup returns its PTR records. Use it to confirm that a sending IP has a hostname, or to see what a server calls itself.

04

Structured for automation

MX entries carry a numeric priority, CAA entries are split into flag, tag and value, and SOA timers are integers. You can diff two responses or assert on a field without writing a zone-file parser.

[03/Try it]

See the response before you sign up

Fill in the request and run it. The dashboard has the same form, plus history, bulk upload and live data.

POST /v1/dns-lookup2 credits

A domain, or an IP address for reverse DNS.

Preview mode: this page returns a sample response so you can see the shape of the data. Create a key to run it on live data.

Response

Fill in the field and run the lookup to see what comes back.

[04/Integrate]

One POST request

Send JSON with a Bearer key. The same key works for all 79 products.

curl -X POST https://api.1lookup.dev/v1/dns-lookup \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain":"example.com"}'
Endpoint
POST /v1/dns-lookup
Base URL
https://api.1lookup.dev
Request
domain
Price
2 credits
Coverage
Global
Bulk
CSV upload and bulk API
Cache
Repeats within 7 days are free
Also via
Dashboard and MCP server (run_lookup)
[05/Use cases]

What teams use it for

Verify a customer's DNS setup

When a customer adds a custom domain, look it up and confirm the CNAME or TXT record you asked for is live before you activate it.

Segment prospects by email platform

Run a list of company domains through the bulk API and group them by mail_provider to target accounts on a specific email service.

Debug mail delivery

Pull MX and TXT records to confirm mail is routed where you expect and that an SPF policy exists. For a graded SPF, DKIM and DMARC review, use Email Authentication Check.

Track infrastructure changes

Look up key domains on a schedule with "fresh": true and compare NS, A and MX values with the previous run to catch a migration or a hijacked record.

Domains that use geographic or load-based routing can return different A records in different places. The response shows one answer, taken at lookup time.

[06/Cost]

2 credits

Credits come with your plan and work on every product. Requests that fail on our side are never charged. Beyond your plan, extra credits are pay as you go.

See pricing
PlanPer 1,000 creditsPer 1,000 lookups
Starter $29/mo$4.83$9.67
Growth $99/mo$3.96$7.92
Pro $299/mo$3.32$6.64
Scale $799/mo$2.66$5.33
[07/FAQ]

DNS Lookup questions

Which DNS record types are returned?

A, AAAA, CNAME, MX, TXT, NS, SOA and CAA for a domain. When the input is an IP address you get PTR records instead. Other record types are not part of the response today.

How do I run a reverse DNS lookup?

Put the IP address in the domain field. The response lists the PTR hostnames published for that address. An address with no PTR record comes back with an empty list.

How much does a DNS lookup cost?

2 credits per domain or IP, covering every record type in that one response. The smallest plan, $29 a month, includes 6,000 credits, enough for 3,000 lookups.

How fresh are the DNS records?

A new lookup queries DNS at request time. Results are then cached for 7 days, so a repeat request returns the stored answer unless you pass "fresh": true. Do that right after you change a record.

How are the mail provider and DNS host detected?

They are inferred from the MX and NS hostnames. A domain that puts a filtering gateway in front of its mail shows the gateway, and one that runs its own nameservers may return null. The raw records are always included so you can check.

[ Validate ][ Enrich ]
[Get started]

Run DNS Lookup on your own data

Starter is $29 a month for 6,000 credits, enough for 3,000 lookups a month.

[ Screen ][ Scrape ]