rel="dns-prefetch"
- Job
- Asks the browser to resolve the host name early
dns-prefetch is a resource hint that resolves a cross-origin domain name before a request needs it. Syntax, how it differs from preconnect, and a check.
dns-prefetch is a link hint that asks the browser to resolve a cross-origin domain to an IP address before any resource on it is requested, hiding some DNS lookup latency. It does only the DNS step. Preconnect also opens the connection, so it costs more and suits only the most critical origins.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
rel="dns-prefetch"hrefcrossorigin attribute<link rel="dns-prefetch" href="https://fonts.googleapis.com/">Link: <https://fonts.googleapis.com/>; rel=dns-prefetchdns-prefetchpreconnectpreloadMDN says pairing both is a common pattern: browsers that don't support preconnect still get the dns-prefetch benefit. MDN also says dns-prefetch has broader support than preconnect, and that browsers ignore hints they don't recognize.
<link rel="preconnect" href="https://fonts.googleapis.com/" crossorigin>
<link rel="dns-prefetch" href="https://fonts.googleapis.com/">Fonts load in anonymous mode, so MDN says to add crossorigin to the preconnect hint. Without it, the browser performs only the DNS lookup and doesn't set up the connection the anonymous request will use. The dns-prefetch line doesn't need the attribute.
dns-prefetch links for the Guardian's asset hosts. Run it on your page and compare the hinted origins to the third-party hosts in the DevTools Network panel. A hint for an origin the page never requests is wasted, and an unhinted host on the critical path is a candidate.preconnectpreconnect hintpreconnect to the same host with no need for a fallbackcurl -sL -A 'Mozilla/5.0' https://www.theguardian.com/ \
| grep -o -i '<link[^>]*dns-prefetch[^>]*>' | head1 questions people ask next, answered from the sources on this page.
It is a performance hint, not a ranking directive. It can shave time off third-party loads, which you can measure in the Network panel or Lighthouse. Measure before and after rather than assuming a gain.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.