X-DNS-Prefetch-Control

The HTTP X-DNS-Prefetch-Control response header is used to control client browser DNS prefetching, which proactively resolves domain names for links on the page.

Usage

The HTTP X-DNS-Prefetch-Control response header is a feature intended to reduce page load times for links that the client may select as the page is being viewed. Although DNS requests use little bandwidth, the latency can be high enough that users notice a delay when clicking on a link. By setting X-DNS-Prefetch-Control to on, it will resolve names in the background, eliminating the step if needed later.

Note

The "X-" naming convention for HTTP headers, "X" referring to "experimental", has been deprecated and need to be transitioned to formal naming convention for HTTP headers.

Example

When the on directive is set, it enables prefetching. For supporting browsers, this is the default value when the HTTP header is not included. This can implement page load times considerably in some cases.

X-DNS-Prefetch-Control: on

When the off directive is set, it disables prefetching.

X-DNS-Prefetch-Control: off

Takeaway

The HTTP X-DNS-Prefetch-Control header is used to inform the client as to whether DNS prefetching to be done for links on the site.

See also

Last updated: June 20, 2022