Table of Content
- Browser Compatibility
- How to modify X-DNS-Prefetch-Control header The X-DNS-Prefetch-Control HTTP header is a security header that controls DNS prefetch, a feature that enables browsers to proactively perform domain name resolution on both links that the user might choose to follow as well as URLs for items referenced by the document. This helps in reducing latency in certain situations. It's an implementation of the DNS prefetching or pre-resolve feature.
The syntax for the X-DNS-Prefetch-Control HTTP header is simply:
For the X-DNS-Prefetch-Control header, there are two directives:
on: DNS prefetching is allowed.
off: DNS prefetching is not allowed.
Here's a simple usage of the X-DNS-Prefetch-Control header:
This allows prefetching of DNS for links and URLs in the document.
If you don't want prefetching, just put
(Note: The compatibility can change from time to time, always refer back to updated documentation for precise information).
How to modify X-DNS-Prefetch-Control header
ModHeader is a Chrome extension that allows you to modify your HTTP request and response headers. To modify the X-DNS-Prefetch-Control header:
- Install the ModHeader plugin from the Chrome web store.
- Click on the ModHeader icon on your browser’s toolbar.
- Enter "X-DNS-Prefetch-Control" under 'Response headers'.
- Put either 'on' or 'off' in the next field to the right.
- Now your header is modified and you can browse with the new settings.
The ModHeader tool is especially useful for developers and testers who need to change the headers often for testing or debugging purposes.