Pular para o conteúdo
POST AI agent ready /v1/dns/lookup

DNS Lookup API - Free DNS Record Query

Queries DNS records for a domain using Cloudflare DNS-over-HTTPS. Supports A, AAAA, MX, TXT, CNAME, NS, SOA, and PTR record types.

Parameters

stringrequired

Domain name to look up.

string

DNS record type to query.

Code examples

curl -X POST https://api.botoi.com/v1/dns/lookup \
  -H "Content-Type: application/json" \
  -d '{"domain":"github.com","type":"A"}'

When to use this API

Verify domain configuration during onboarding

When a customer adds a custom domain to your SaaS platform, query their CNAME or A records to confirm the DNS is pointing to your servers. Show a green checkmark once the records match your expected values.

Monitor MX record changes for email deliverability

Schedule periodic MX lookups for your sending domain to detect unexpected changes. Alert your ops team if an MX record is removed or changed, which could indicate a DNS hijack or misconfiguration affecting email delivery.

Audit TXT records for SPF and DKIM compliance

Query TXT records for a domain to extract SPF and DKIM entries. Parse the values to verify they match your expected configuration and flag domains with missing or overly permissive policies.

Frequently asked questions

Which DNS resolver does this endpoint use?
Queries go through Cloudflare DNS-over-HTTPS (1.1.1.1). This provides fast, privacy-respecting resolution without caching stale records.
What record types are supported?
A, AAAA, CNAME, MX, NS, TXT, SOA, SRV, CAA, and PTR. Specify the type parameter; it defaults to A if omitted.
Can I look up subdomains?
Yes. Pass the full subdomain (e.g. "api.github.com") as the domain parameter. The endpoint resolves whichever domain string you provide.
What does query_time_ms represent?
query_time_ms is the time in milliseconds the DNS resolution took on the server side. It does not include network round-trip time from your client to the API.
Does this return all records of the requested type?
Yes. If a domain has multiple A records or multiple MX records, all of them are returned in the records array with their individual TTL values.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.