{"id":107619,"date":"2020-06-30T12:34:17","date_gmt":"2020-06-30T17:34:17","guid":{"rendered":"https:\/\/wpengine.com\/?post_type=resource&#038;p=107619"},"modified":"2025-03-27T11:42:02","modified_gmt":"2025-03-27T16:42:02","slug":"reduce-dns-lookups","status":"publish","type":"resource","link":"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/","title":{"rendered":"Guide to Reducing DNS Lookups"},"content":{"rendered":"\n<p>DNS lookups are an element that many website owners overlook. Unfortunately, too many lookups can reduce the loading speed of your pages, and <a href=\"https:\/\/wpengine.com\/resources\/improve-wordpress-site-speed\/#Why_Is_Site_Speed_Important\" target=\"_blank\" rel=\"noreferrer noopener\">slow loading speeds<\/a> can lead to higher bounce rates and lower search engine rankings.\u00a0<\/p>\n\n\n\n<p>There are steps you can take to reduce your DNS lookups as well as WordPress plugins that can handle this task for you. To get the job done effectively, you\u2019ll need to first understand more about DNS lookups and what kind of response time you\u2019re aiming for.\u00a0<\/p>\n\n\n\n<p>In this article, we\u2019ll discuss what DNS lookups are and what a good DNS response time is. We\u2019ll then explain how to reduce DNS lookups, and consider some of the plugins you can use. Let\u2019s get started!<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">What is a DNS lookup?<\/h2>\n\n\n\n<p>Domain Name Servers (DNSs) are the foundation of the internet. They work like phone books for websites, linking each site to a unique IP address. A DNS lookup, then, is the process of finding the right IP address for a given website URL.\u00a0<\/p>\n\n\n\n<p>The responsibility of this lookup falls on the web browser. When you type a URL into your search bar, your browser finds all the resources that require a DNS lookup. It then waits for the lookup to process before downloading any of those resources. <\/p>\n\n\n\n<p>The more lookups a website requires, the longer it takes for the browser to render its pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is a good DNS response time?<\/h2>\n\n\n\n<p>Knowing what DNS lookups are can help you understand the importance of reducing them. However, you still need to check and see if they are currently causing a problem on your website. To do this, you can use an online testing solution.<\/p>\n\n\n\n<p>To run a DNS lookup test, you\u2019ll simply need to provide your website\u2019s URL. Then click on <em>Go<\/em>, and Ultra Tools will test your DNS response time.<\/p>\n\n\n\n<p>While this provides some insight into your website, you still need to know what a good DNS response time is. These tools record lookups in microseconds. The lower the number is, the better the response time will be.<\/p>\n\n\n\n<p><a href=\"https:\/\/gtmetrix.com\/reduce-dns-lookups.html\" target=\"_blank\" rel=\"noreferrer noopener\">According to YSlow<\/a>, DNS lookups generally take between 20ms and 120ms. If the test places your site\u2019s response time on the higher end of that scale, you might want to consider reducing your lookups, as more than 100ms of load time for a DNS lookup can translate into multiple seconds of delay on your page loading.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How do I reduce my DNS lookups?<\/h2>\n\n\n\n<p>Reducing DNS lookups on your website can improve loading speeds and <a href=\"https:\/\/wpengine.com\/resources\/improve-bounce-rate\/\" target=\"_blank\" rel=\"noreferrer noopener\">reduce bounce rates<\/a>. If you use a page speed tester, many will provide you with recommendations on how to get started. Otherwise, here are some of the best steps you can take.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Use a fast DNS service<\/h3>\n\n\n\n<p>The first step is to reduce the response time for DNS lookups. One of the best ways to do this is by using a fast DNS service. Many people use the DNS provided by their domain registrars, such as Namecheap or GoDaddy. However, these free DNS options are often too slow.<\/p>\n\n\n\n<p>Premium DNS providers generally have faster response times. For example, large providers such as Cloudflare have extensive infrastructure and global data centers. This can reduce the impact that DNS lookups have on the speed of your website. Additionally, these larger providers will have extra security features to help mitigate risks of <a href=\"https:\/\/www.imperva.com\/learn\/application-security\/dns-hijacking-redirection\/\" target=\"_blank\" rel=\"noreferrer noopener\">DNS hijacking<\/a> or other attacks.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Reduce the number of hostnames<\/h3>\n\n\n\n<p>One of the easiest ways to reduce DNS lookups is to get rid of requests for different hostnames. When you run your website through a speed test such as <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/insights\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google PageSpeed Insights<\/a>, a list of hostnames and assets that trigger a DNS request is provided.<\/p>\n\n\n\n<p>You can audit this list to reduce the number of requests. External requests for graphics, such as social icon buttons, each require a unique DNS lookup. During your audit, check to see if these resources are essential to your user&#8217;s experience on-site. Then, you can weigh the speed cost of the DNS lookup against the benefit of keeping the resource.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Host third-party resources locally<\/h3>\n\n\n\n<p>If you find that you still have a number of external resources after your hostname audit, consider hosting the resources locally instead. Local hosting both provides more control over caching and the delivery of these resources and eliminates the DNS lookup step.\u00a0<\/p>\n\n\n\n<p>To host the resources, download the files you need from whenever they\u2019re currently stored, and upload them to your web server or <a href=\"https:\/\/wpengine.com\/support\/how-does-a-cdn-work\/\" target=\"_blank\" rel=\"noreferrer noopener\">CDN<\/a>. If you use WP Engine, you can <a href=\"https:\/\/wpengine.com\/resources\/what-is-a-cdn-how-do-they-work\/#How_to_Set_Up_a_CDN\" target=\"_blank\" rel=\"noreferrer noopener\">enable our CDN<\/a> and host the files there.&nbsp;<\/p>\n\n\n\n<p>If you have requests for frequently updated scripts such as font libraries, however, hosting them locally might not be the best solution. Because these resources are updated often, their scripts are better left alone, and other steps can be taken to reduce the impact of their DNS lookups.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Use DNS caching<\/h3>\n\n\n\n<p>Another method of reducing DNS lookups is to take advantage of DNS caching. This stops the browser from requesting a lookup every time it requires an element on your website.<\/p>\n\n\n\n<p>The DNS cache acts as storage holding the hostname for a set amount of time. When a browser requests the element, the cache is able to provide the hostname instead of requiring a DNS lookup.\u00a0<\/p>\n\n\n\n<p>The length of the DNS cache is determined by the Time To Live (TTL). Not all DNS records should be cached for the same amount of time. Some commonly-accepted guidelines are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>CNAME Records<\/strong>: 24 hour cache<\/li>\n\n\n\n<li><strong>A and AAAA Records<\/strong>: Five minutes to one hour cache<\/li>\n\n\n\n<li><strong>TXT Records<\/strong>: 12 hour cache<\/li>\n\n\n\n<li><strong>MX Records<\/strong>: 12 hour cache<\/li>\n<\/ul>\n\n\n\n<p>When <a href=\"https:\/\/wpengine.com\/support\/cache\/\" target=\"_blank\" rel=\"noreferrer noopener\">setting up DNS caching<\/a>, keep in mind that the TTL values will usually be shown in seconds. This will need to be taken into account when defining your values.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Make use of DNS prefetching<\/h3>\n\n\n\n<p>Prefetching enables browsers to perform DNS lookups in the background. As a user reads one web page, the browser will request prefetch elements. This is primarily used for links within your content.&nbsp;<\/p>\n\n\n\n<p>It is easy to set up DNS prefetching, by adding the <a href=\"https:\/\/gist.github.com\/jennimckinnon\/5a95f476ffa7f7b3906f842dcb53a868#file-single-php\" target=\"_blank\" rel=\"noreferrer noopener\">following code<\/a> to the header of your <em>single.php<\/em> file (under <em>Appearance<\/em> &gt; <em>Theme Editor<\/em>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- DNS Prefetching --&gt;\n&lt;link rel=\"dns-prefetch\" href=\"\/\/asset1.com\"&gt;\n&lt;link rel=\"dns-prefetch\" href=\"\/\/asset2.com\"&gt;<\/code><\/pre>\n\n\n\n<p>Paste the code in this file either at the top or bottom, and change <em>asset1.com<\/em> and <em>asset2.com<\/em> to the links you want to prefetch. You can also add as many additional URLs as you need.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Plugins to reduce DNS lookups<\/h2>\n\n\n\n<p>While it is possible to manually reduce your DNS lookups in WordPress, there are plugins that can make the process easier. These plugins won\u2019t handle every aspect of reducing DNS lookups. However, they can automate certain steps, such as using browser caching and CDN hosting.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. <a href=\"https:\/\/wp-rocket.me\/\" target=\"_blank\" rel=\"noreferrer noopener\">WP Rocket<\/a><\/h3>\n\n\n\n<p><a href=\"https:\/\/wpengine.com\/solution-center\/wp-rocket\/\" target=\"_blank\" rel=\"noreferrer noopener\">WP Rocket<\/a> is a premium plugin that works with WP Engine\u2019s caching layers. It offers preloading of content and lazy loading for images. This speeds up the rendering of your website and reduces the DNS lookups.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\" target=\"_blank\" rel=\"noreferrer noopener\">LiteSpeed Cache<\/a><\/h3>\n\n\n\n<p><a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\" target=\"_blank\" rel=\"noreferrer noopener\">LiteSpeed Cache<\/a> offers browser caching and a free CDN cache. You can also use it to configure DNS prefetch if you are unsure about adding code manually. LiteSpeed Cache also enables code minification and object caching, and you can even use the plugin to lazy load images in order to further improve loading speeds.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Build customized digital experiences on WP Engine<\/h2>\n\n\n\n<p>Reducing your DNS lookups is a key method of improving your website\u2019s loading speeds. There are many steps you can take to reduce these lookups and speed up response times. Taking advantage of DNS caching and prefetching is important, but you also need a fast DNS service.&nbsp;<\/p>\n\n\n\n<p>A quality <a href=\"https:\/\/wpengine.com\/wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">hosting provider for WordPress<\/a> can help with that last step. <a href=\"https:\/\/wpengine.com\/plans\/\" target=\"_blank\" rel=\"noreferrer noopener\">At WP Engine<\/a>, we offer built-in caching and DNS services. so you have more time to focus on <a href=\"https:\/\/developer.wordpress.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress development<\/a> and creating an incredible digital experience!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DNS lookups are an element that many website owners overlook. Unfortunately, too many lookups can reduce the loading speed of your pages, and slow loading speeds can lead to higher bounce rates and lower search engine rankings.\u00a0 There are steps you can take to reduce your DNS lookups as well as WordPress plugins that can<span class=\"tile__ellipses\">&hellip;<\/span><span class=\"tile__ellipses--animated\"><\/span><\/p>\n","protected":false},"author":177,"featured_media":107623,"template":"","resource-topic":[912],"resource-role":[896,1296,899],"resource-type":[916],"class_list":["post-107619","resource","type-resource","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Reduce DNS Lookups for WordPress<\/title>\n<meta name=\"description\" content=\"Need to reduce your DNS lookup time and speed up your WordPress site? Check out our guide to minimizing DNS lookup times.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Reduce DNS Lookups for WordPress\" \/>\n<meta property=\"og:description\" content=\"Need to reduce your DNS lookup time and speed up your WordPress site? Check out our guide to minimizing DNS lookup times.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-27T16:42:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/06\/domain-name-server-featured.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/\",\"url\":\"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/\",\"name\":\"Reduce DNS Lookups for WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\"},\"datePublished\":\"2020-06-30T17:34:17+00:00\",\"dateModified\":\"2025-03-27T16:42:02+00:00\",\"description\":\"Need to reduce your DNS lookup time and speed up your WordPress site? Check out our guide to minimizing DNS lookup times.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resources\",\"item\":\"https:\/\/wpengine.com\/case-studies\/resources\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Guide to Reducing DNS Lookups\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\",\"url\":\"https:\/\/wpengine.com\/case-studies\/\",\"name\":\"WP Engine\",\"description\":\"Managed Hosting for WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/aba73ed4c15eda43b5fd78844ec31fad\",\"name\":\"Samantha Rodriguez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/933722cf8761e0c08fbced6085998032df460c5ecfa2481d9cd16f569f3da2c1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/933722cf8761e0c08fbced6085998032df460c5ecfa2481d9cd16f569f3da2c1?s=96&d=mm&r=g\",\"caption\":\"Samantha Rodriguez\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Reduce DNS Lookups for WordPress","description":"Need to reduce your DNS lookup time and speed up your WordPress site? Check out our guide to minimizing DNS lookup times.","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"Reduce DNS Lookups for WordPress","og_description":"Need to reduce your DNS lookup time and speed up your WordPress site? Check out our guide to minimizing DNS lookup times.","og_url":"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/","og_site_name":"WP Engine","article_publisher":"https:\/\/www.facebook.com\/wpengine","article_modified_time":"2025-03-27T16:42:02+00:00","og_image":[{"width":1100,"height":500,"url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/06\/domain-name-server-featured.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@wpengine","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/","url":"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/","name":"Reduce DNS Lookups for WordPress","isPartOf":{"@id":"https:\/\/wpengine.com\/case-studies\/#website"},"datePublished":"2020-06-30T17:34:17+00:00","dateModified":"2025-03-27T16:42:02+00:00","description":"Need to reduce your DNS lookup time and speed up your WordPress site? Check out our guide to minimizing DNS lookup times.","breadcrumb":{"@id":"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/case-studies\/resources\/reduce-dns-lookups\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/case-studies\/"},{"@type":"ListItem","position":2,"name":"Resources","item":"https:\/\/wpengine.com\/case-studies\/resources\/"},{"@type":"ListItem","position":3,"name":"Guide to Reducing DNS Lookups"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/case-studies\/#website","url":"https:\/\/wpengine.com\/case-studies\/","name":"WP Engine","description":"Managed Hosting for WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/aba73ed4c15eda43b5fd78844ec31fad","name":"Samantha Rodriguez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/933722cf8761e0c08fbced6085998032df460c5ecfa2481d9cd16f569f3da2c1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/933722cf8761e0c08fbced6085998032df460c5ecfa2481d9cd16f569f3da2c1?s=96&d=mm&r=g","caption":"Samantha Rodriguez"}}]}},"acf":[],"grid_image_url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2020\/06\/domain-name-server-grid.jpg","media-type":{"term_id":916,"name":"Article","slug":"article"},"role":"<strong>Roles:<\/strong> Developer, Publisher, Site Owner","topic":"<strong>Topics:<\/strong> Performance","_links":{"self":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource\/107619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource"}],"about":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/types\/resource"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/users\/177"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media\/107623"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media?parent=107619"}],"wp:term":[{"taxonomy":"resource-topic","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-topic?post=107619"},{"taxonomy":"resource-role","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-role?post=107619"},{"taxonomy":"resource-type","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-type?post=107619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}