# dns-prefetch

> 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.

Canonical: https://scaplet.com/glossary/dns-prefetch

Glossary Glossary · Performance

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.

2 min

read

1

sources

Oct 29, 2026

updated

Scaplet Editorial Team

author

In one line

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.

30-second check

## Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fdns-prefetch%20(%22dns-prefetch%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fdns-prefetch%20(%22dns-prefetch%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fdns-prefetch%20(%22dns-prefetch%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fdns-prefetch%20(%22dns-prefetch%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## At a glance

4 facts from the sources below

DNS lookup only

Does

Cross-origin domains

Applies to

link element or Link header

Forms

Ignore the hint, nothing breaks

Unsupported browsers

_01_At a glance

## Anatomy of the hint

Part

### `rel="dns-prefetch"`

Job

Asks the browser to resolve the host name early

Part

### `href`

Job

The third-party origin whose domain should be resolved

Part

### No `crossorigin` attribute

Job

It only does DNS, so the attribute isn't needed

In the document head

```
<link rel="dns-prefetch" href="https://fonts.googleapis.com/">
```

Or as a response header

```
Link: <https://fonts.googleapis.com/>; rel=dns-prefetch
```

_02_At a glance

## dns-prefetch or preconnect?

Hint

### `dns-prefetch`

Work done early

DNS lookup

Cost

Low

Use for

Many third-party origins, less critical ones

Hint

### `preconnect`

Work done early

DNS, TCP, and TLS for [HTTPS](/glossary/https)

Cost

Higher

Use for

The few origins that matter most. See [preconnect](/glossary/preconnect)

Hint

### `preload`

Work done early

Fetches one specific file

Cost

A request

Use for

A known critical resource. See [preload](/glossary/preload)

MDN 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.

The common pairing for a font host

```
<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.

**Hinting your own origin does nothing**MDN says to use it for cross-origin domains only, because your own domain is already resolved by the time the hint is read. Overusing `preconnect` across many third parties can also backfire, so keep it for the critical few.

_03_Your call

## Check it in 2 minutes

At the time of writing this prints `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.

If this fits

### Add dns-prefetch if

- The page loads from several third-party hosts
- The host isn't important enough to justify a full `preconnect`
- You want a fallback beside a `preconnect` hint

Or

### Skip it if

- The resource comes from your own origin
- You already `preconnect` to the same host with no need for a fallback
- The third-party request happens late, if at all

List the hints a live page sends

```
curl -sL -A 'Mozilla/5.0' https://www.theguardian.com/ \ | grep -o -i '<link[^>]*dns-prefetch[^>]*>' | head
```

Questions

## Asked a lot.

1 questions people ask next, answered from the sources on this page.

_01_ Does dns-prefetch improve SEO?

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](/glossary/lighthouse). Measure before and after rather than assuming a gain.

Sources · 1

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- mozilla.org

1. 01 [dns-prefetch (MDN)](https://developer.mozilla.org/en-US/docs/Web/Performance/Guides/dns-prefetch) developer.mozilla.org · checked 2026-11-01

## Keep learning

[All glossary](/glossary)

[Learn Critical rendering path Performance](/glossary/critical-rendering-path) [Related Largest Contentful Paint Performance](/glossary/largest-contentful-paint) [Read next preload Performance](/glossary/preload) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[Disavow file](/glossary/disavow) [Discontinued products](/glossary/discontinued-products) [Domain age](/glossary/domain-age) [Domain Authority](/glossary/domain-authority)

More in Performance
[Brotli compression](/glossary/brotli-compression) [Cache-Control](/glossary/cache-control) [CDN](/glossary/cdn) [Chrome UX Report (CrUX)](/glossary/chrome-ux-report) [Content Security Policy](/glossary/content-security-policy) [Content-Length (HTTP header)](/glossary/content-length) [Core Web Vitals](/glossary/core-web-vitals) [Core Web Vitals report](/glossary/core-web-vitals-report) [CORS](/glossary/cors) [Critical CSS](/glossary/critical-css) [Critical rendering path](/glossary/critical-rendering-path) [Cumulative Layout Shift (CLS)](/glossary/cumulative-layout-shift) [dns-prefetch](/glossary/dns-prefetch) [Edge caching](/glossary/edge-caching) [fetchpriority](/glossary/fetchpriority) [First Contentful Paint](/glossary/first-contentful-paint) [First Input Delay (FID)](/glossary/first-input-delay) [font-display](/glossary/font-display) [Gzip compression](/glossary/gzip-compression) [HTTP caching](/glossary/http-caching) [HTTP/2](/glossary/http-2) [HTTP/3](/glossary/http-3) [Image compression](/glossary/image-compression) [Interaction to Next Paint (INP)](/glossary/interaction-to-next-paint)

Terms on this page
[HTTPS](/glossary/https) [preconnect](/glossary/preconnect) [preload](/glossary/preload) [Lighthouse](/glossary/lighthouse)

Free · 2 minutes

## Know the term. _Now check your site._

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
