DNS Record Lookup
Query DNS records for any domain using Cloudflare DNS-over-HTTPS.
DNS Record Lookup queries DNS records for any domain using Cloudflare's public DNS-over-HTTPS resolver. This is a network tool: every lookup makes an outbound request from your browser to https://cloudflare-dns.com/dns-query with an Accept: application/dns-json header — a third-party service, not a first-party server. Enter a domain (placeholder "e.g. example.com"), pick a record type (A, AAAA, CNAME, MX, NS, TXT, SOA), and hit "Lookup DNS Records".
Results render as a Type / Data / TTL table with a meta line showing client-measured query time in milliseconds and the record count. Copy flattens rows to TSV-style lines with an explicit TTL: prefix; empty answers report "No records found for {type} type." DNS errors map RCODEs to readable strings ("Non-existent domain", "Query refused", "Server error", …). Everything after the fetch — timing, mapping, display — is local.
How it works
lookupDns in lib/dnsLookup.ts issues fetch('https://cloudflare-dns.com/dns-query?name={domain}&type={type}', { headers: { Accept: 'application/dns-json' } }) — the only outbound network destination. Query time is a performance.now() delta measured around that fetch and rounded to milliseconds. DNS_RECORD_TYPES limits selection to A, AAAA, CNAME, MX, NS, TXT, SOA.
A non-zero DNS Status (RCODE) maps through errorMessages: 1→"Server error", 2→"Server failure", 3→"Non-existent domain", 4→"Not implemented", 5→"Query refused", else "DNS query error (status {n})"; transport failures show "DNS query failed: {statusText}". Answers map via resolveRecordType (1→A, 2→NS, 5→CNAME, 6→SOA, 15→MX, 16→TXT, 28→AAAA, else TYPE{n}) with TTL. State lives in dnsLookupSlice.
How to use
- Step "Input" — enter Domain Name (placeholder "e.g. example.com"); empty → error "Please enter a domain".
- Select Record Type: A, AAAA, CNAME, MX, NS, TXT, or SOA.
- Click "Lookup DNS Records" — the request goes to cloudflare-dns.com; button shows "Looking up...".
- Toast "DNS lookup complete!" on success; read the meta line: "Query time: {n}ms • {count} record(s)".
- Inspect table rows (Type badge / Data / TTL rendered "{ttl}s").
- Copy all records as type\tdata\tTTL: n lines (toast "Records copied!").
- "Clear" resets (toast "Cleared!"); no answers → "No records found for {type} type."
Tips
- Uses the JSON DNS API (Accept: application/dns-json) — no local resolver or dig binary is needed.
- Query time is client-measured around the fetch with performance.now(), so it includes HTTPS overhead to Cloudflare.
- Non-existent domains return RCODE 3 → "Non-existent domain" — a fast way to check whether a domain exists.
- Copy format is TSV-style with an explicit TTL: prefix — easy to paste into notes or a spreadsheet.
- Your queried domain leaves the browser and is sent to Cloudflare's resolver — don't query internal-only names expecting privacy from Cloudflare.
DNS Record Lookup FAQ
Which resolver is used?
Cloudflare DNS-over-HTTPS at https://cloudflare-dns.com/dns-query — an outbound third-party API called directly from your browser.
What record types are supported?
A, AAAA, CNAME, MX, NS, TXT, SOA — the DNS_RECORD_TYPES list in lib/dnsLookup.ts.
What does "Query refused" mean?
DNS RCODE 5 (REFUSED), mapped from the response Status field in the errorMessages table.
How is query time measured?
A performance.now() delta rounded to milliseconds around the fetch to Cloudflare.
Is a first-party server involved?
No — the browser talks directly to cloudflare-dns.com; the only third-party network call is that DoH request.
Credits
- Cloudflare DNS-over-HTTPS — JSON DoH endpoint used by lookupDns in lib/dnsLookup.ts — outbound third-party API