How to reduce DNS searches of a website

When you type in your browser, a DNS resolution contacts the browser, returns the IP address of the server

DNS has a cost. Which is generally 20-120 milliseconds for DNS to find the IP address of a given hostname. The browser cannot download anything from this hostname until the DNS lookup has completed.

DNS lookups are cached for best performance. This caching can take place on a special cache server, maintained by the user of the ISP or local area network, but there is also the caching that occurs on each user's individual computer. The DNS information remains in the DNS cache of the Operating System (the "DNS Client service" in Microsoft Windows). Many browsers have their own caches, separate from the operating system cache. To the extent that the browser stores a DNS record in its own cache, it does not infer the operating system with a request for that record.

Internet Explorer caches DNS lookups for 30 minutes by default, specifying the "DnsCacheTimeout" registry entry. Firefox caches DNS lookups for 1 minute, controlled by the "network.dnsCacheExpiration" option in the browser settings. (Fasterfox changes this to 1 hour.)

When the client's DNS cache is empty (in both the browser and the operating system), the number of DNS lookups equals the number of unique hostnames on the web page. This includes the hostnames used in the page URL, images, script files, style sheets, Flash animations, etc. Reducing the number of unique hostnames reduces the number of DNS lookups.

Reducing the number of unique hostnames has the potential to reduce the number of parallel downloads that take place on the page. Avoiding DNS lookups shortens response times, but reducing parallel downloads can increase them. My preference is to divide these components across at least two, but no more than four hostnames. This results in a good compromise between reducing DNS lookups and allowing a high degree of parallel downloads.

Date update on 2020-11-13. Date published on 2020-11-13. Category: Computer class Author: Oscar olg Fuente: tecnologia