Skip to main content

New series: how one WordPress checkbox cost a site 7 months of Google traffic, and the full rescue in 21 lessons. Read the series

Glossary term

dns-prefetch

Updated Nov 18, 2026

In short

A browser hint, written as a link tag in a page's head, that tells the browser to look up a domain's IP address early, so a later request to that domain skips the DNS delay.

dns-prefetch is a resource hint that asks the browser to resolve a domain name ahead of time. It is added to a page as a link tag in the head, for example <link rel="dns-prefetch" href="https://fonts.example.com">, where the address is the origin you expect to use later.

Every new domain a page talks to needs a Domain Name System (DNS) lookup, which turns the name into an IP address. That lookup takes time before any connection can start. With dns-prefetch, the browser does it in the background while it is busy with other work, so by the time the page actually requests something from that domain, the answer is already known.

The key point is how little it does. It only performs the DNS lookup. It does not open a connection or run the TLS handshake, which is why it is cheap. A related hint, preconnect, goes further by doing the lookup, opening the connection and completing the handshake early. That saves more time but uses more resources, so it is best kept for the few domains you are sure the page needs right away. dns-prefetch suits less certain or less important domains, and it is often used as a fallback next to preconnect.

A common mistake is adding it for every domain on the page, which adds noise for little gain, or for the page's own domain, which the browser has already resolved. It also does nothing for resources that load from a domain the browser already knows.

An example: a blog loads a comment widget from another domain only after the visitor scrolls. A dns-prefetch hint prepares the address cheaply, without paying for a full connection that might never be used.