Article

Why a Web Page Can't Do a Real DNS Lookup All By Itself

Published 2026-09-14

DNS is a low-level network protocol

The Domain Name System (DNS) resolves a human-readable domain into an IP address (and other record types) through a specific low-level network query protocol, historically operating over raw UDP/TCP sockets that talk directly to DNS servers.

Why browsers don't expose this to web pages

Browsers deliberately do not give web page JavaScript direct access to raw network protocols like this, for security reasons — allowing arbitrary web pages to send custom low-level network packets would open up serious abuse potential (scanning internal networks, probing infrastructure the page's own origin has no business touching).

The workaround: DNS over HTTPS

A newer standard called DNS-over-HTTPS (DoH) lets a DNS query be sent as a normal HTTPS request instead, which a browser page's JavaScript can make, since it's just an ordinary web request rather than a raw network protocol. Public DNS providers like Google and Cloudflare run DoH-compatible endpoints specifically so tools like this one can query DNS records from client-side code.

Try it yourself

Our DNS Lookup tool calls Google's public DNS-over-HTTPS service directly from your browser to look up a domain's records — the only way a purely browser-based tool can perform a real DNS lookup at all.

Ready to try it yourself?
Open the DNS Lookup →