A fast, dependency-light DNS lookup service β 10 record types, 9 public resolvers, one JSON response.
Built in Go. Concurrent by design. Ships with Prometheus metrics, per-IP rate limiting, and a clean web UI out of the box.
Live Demo Β· API Example Β· Report a Bug
DNS Lookup API is a self-hostable HTTP service that resolves A, AAAA, NS, MX, TXT, CNAME, SOA, SRV, CAA, and reverse PTR records for any domain or IP address β queried live against nine independent public DNS resolvers (Google, Cloudflare, Quad9, OpenDNS, and more). Every lookup returns a single, predictable JSON object, making it easy to drop into scripts, dashboards, or your own tools without wrestling with dig output or writing your own DNS client.
It's written in Go with no runtime dependencies beyond the binary itself, resolves record types concurrently for low latency, and comes instrumented with Prometheus metrics so you can watch it in production from day one.
- Features
- Live Demo
- Quick Start
- API Reference
- Supported Record Types
- Supported Resolvers
- Rate Limiting
- Monitoring
- Roadmap
- Contributing
- License
- Support the Project
- β‘ Concurrent resolution β every record type is queried in parallel, so a full lookup takes about as long as the slowest single query, not the sum of all of them.
- π 9 public resolvers β Google, Cloudflare, OpenDNS, Quad9, AdGuard, DNS.WATCH, Comodo, CleanBrowsing, and UltraDNS, selectable per request.
- π Reverse DNS (PTR) β pass an IP address instead of a domain and get its PTR record automatically.
- π¦ Predictable JSON β one consistent response shape for every record type, ready to consume from any language.
- π‘οΈ Per-IP rate limiting β built-in protection against abuse, no extra proxy required.
- π Prometheus metrics β request durations, upstream query durations, and active worker counts, exposed on
/metrics. - π©Ί Health checks β a dedicated
/healthendpoint for uptime monitors and orchestrators. - π₯οΈ Web UI included β a lightweight, embedded front end for quick manual lookups, no separate deployment needed.
- π§΅ Zero external runtime dependencies β a single static Go binary.
| Web UI | dns.zumbo.net |
| Domain lookup (JSON) | dns.zumbo.net/api/lookup?domain=example.com&resolver=cloudflare |
| Reverse DNS lookup (JSON) | dns.zumbo.net/api/lookup?domain=8.8.8.8&resolver=cloudflare |
# Clone the repository
git clone https://github.com/ufukart/DNS-Lookup-API.git
cd DNS-Lookup-API
# Build
go build -o dns-lookup-api .
# Run (defaults to port 3000)
./dns-lookup-apiThe service is now available at http://localhost:3000 β the web UI on / and the API on /api/lookup.
The service is configured entirely through environment variables:
| Variable | Description | Default |
|---|---|---|
PORT |
Port the HTTP server listens on | 3000 |
TRUSTED_PROXIES |
Comma-separated list of proxy IPs allowed to set X-Forwarded-For / X-Real-IP |
(none) |
Retrieve DNS records for a domain or IP address.
Query parameters:
| Parameter | Required | Description |
|---|---|---|
domain |
β | A hostname (example.com) or an IPv4/IPv6 address for a reverse lookup |
resolver |
β | One of google, cloudflare, opendns, quad9, adguard, dnswatch, comodo, cleanbrowsing, ultradns. Defaults to cloudflare. |
Example request:
curl "https://dns.zumbo.net/api/lookup?domain=example.com&resolver=cloudflare"Example response:
{
"domain": "example.com",
"a": [
{ "ip": "93.184.216.34", "ttl": 300 }
],
"ns": [
{ "host": "a.iana-servers.net", "ip": "199.43.135.53", "ttl": 172800 }
],
"soa": {
"ns": "a.iana-servers.net",
"mbox": "noc.dns.icann.org",
"serial": 2024010101,
"refresh": 7200,
"retry": 3600,
"expire": 1209600,
"min_ttl": 3600,
"ttl": 3600
},
"resolver": "1.1.1.1",
"lookup_time_ms": 42,
"timestamp": "2026-01-01T12:00:00Z"
}Reverse (PTR) lookup:
curl "https://dns.zumbo.net/api/lookup?domain=8.8.8.8&resolver=google"{
"domain": "8.8.8.8",
"ptr": [
{ "value": "dns.google", "ttl": 21600 }
],
"resolver": "8.8.8.8",
"lookup_time_ms": 18,
"timestamp": "2026-01-01T12:00:00Z"
}Simple health check for uptime monitors and load balancers.
{ "status": "healthy" }Prometheus-formatted metrics: request durations, upstream DNS query durations (by record type, resolver, and transport), total requests, and active lookup workers.
| Type | Description |
|---|---|
A |
IPv4 address |
AAAA |
IPv6 address |
NS |
Authoritative name servers |
MX |
Mail exchange servers, with preference |
TXT |
Arbitrary text records (SPF, DKIM, verification, etc.) |
CNAME |
Canonical name / alias |
SOA |
Start of Authority β zone metadata |
SRV |
Service location (target, port, priority, weight) |
CAA |
Certification Authority Authorization |
PTR |
Reverse DNS β resolved automatically when domain is an IP address |
| Resolver | Key | IP Address |
|---|---|---|
| π’ Google Public DNS | google |
8.8.8.8 |
| π΅ Cloudflare | cloudflare |
1.1.1.1 |
| π OpenDNS | opendns |
208.67.222.222 |
| π΄ Quad9 | quad9 |
9.9.9.9 |
| π’ AdGuard DNS | adguard |
94.140.14.14 |
| π΅ DNS.WATCH | dnswatch |
84.200.69.80 |
| π Comodo Secure DNS | comodo |
8.26.56.26 |
| π΄ CleanBrowsing | cleanbrowsing |
185.228.168.9 |
| π’ UltraDNS | ultradns |
64.6.64.6 |
Requests are rate limited per client IP address to keep the service fair and responsive for everyone. Clients that exceed the limit receive an HTTP 429 response. If you're running behind a reverse proxy, set TRUSTED_PROXIES so client IPs are read correctly from X-Forwarded-For / X-Real-IP.
The /metrics endpoint exposes Prometheus metrics out of the box:
dns_api_request_duration_secondsβ end-to-end request latency, by status and resolverdns_query_duration_secondsβ upstream DNS query latency, by record type, resolver, and transport (UDP/TCP)dns_api_requests_totalβ total requests, by statusdns_api_active_workersβ currently active concurrent lookup workers
Point your existing Prometheus/Grafana stack at it and you have latency and error-rate dashboards with no extra instrumentation work.
- Caching for frequently repeated lookups
- API key authentication
- JSON schema validation for responses
Have a feature in mind that isn't listed? Open an issue β suggestions are welcome.
Contributions are welcome and appreciated. To propose a change:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes with a clear message
- Open a pull request describing what changed and why
Bug reports and feature requests are just as valuable β feel free to open an issue for either.
Released under the MIT License. Use it, fork it, ship it.
If this project saves you time, consider buying it a coffee β it helps keep the live demo and future development going.
Questions or feedback? Open a GitHub Issue or submit a PR.
