Link Relationships

HTML rel="dns-prefetch"

Suggests resolving an origin's DNS ahead of use. It does not establish a connection or download a resource; avoid hints for origins unlikely to be contacted. The example belongs in a document head; resource URLs are illustrative. Supply actual resources and server configuration to observe network behavior.

Formal Syntax & Structure

html syntaxhtml
<link rel="dns-prefetch" href="https://assets.example.com">

Parameters & Attributes

NameTypeDescription
relspace-separated relationship tokensInclude dns-prefetch on an element that supports this relationship.
hrefURL or fragmentIdentifies the linked destination or resource.

Working Example

Example Snippethtml
<!doctype html><html lang="en">  <head>    <meta charset="utf-8">    <title>Example</title>    <link rel="dns-prefetch" href="https://assets.example.com">  </head>  <body>    <p>Example document</p>  </body></html>
HTML Reference