
05 July 2020
Pro Tips: Guide to Reducing DNS Lookups
Fortunately, there are steps you can take to reduce your DNS lookups. There are also WordPress plugins that can handle this task for you. To get the job done effectively, though, you’ll need to first understand more about DNS lookups and what kind of response time you’re aiming for.
In this article, we’ll discuss what DNS lookups are and what a good DNS response time is. We’ll then explain how to reduce DNS lookups, and consider some of the plugins you can use. Let’s get started!
- What Is a DNS Lookup?
- What Is a Good DNS Response Time?
- 1. Use a Fast DNS Service
- 2. Reduce the Number of Hostnames
- 3. Host Third-Party Resources Locally
- 4. Use DNS Caching
- 5. Make Use of DNS Prefetching
- WP Rocket
- LiteSpeed Cache
What Is a DNS Lookup?
The responsibility of this lookup falls on the web browser. When you navigate to a website, 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. The more lookups a website requires, therefore, the longer it takes for the browser to render its pages.
What Is a Good DNS Response Time?
According to YSlow, DNS lookups generally take between 20ms and 120ms. If the test places your site’s response time on the higher end of that scale, you might want to consider reducing your lookups.
How Do I Reduce My DNS Lookups?
Reducing DNS lookups on your website can improve loading speeds and reduce bounce rates. 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.
1. Use a Fast DNS Service
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.
2. Reduce the Number of Hostnames
3. Host Third-Party Resources Locally
To host the resources, download the files you need from whenever they’re currently stored, and upload them to your web server or CDN. If you use WP Engine, you can enable our CDN and host the files there.
If you have requests for frequently-updated scripts such as font libraries, however, hosting them locally might not be the best solution. As these resources are updated often, their scripts are better left alone, and other steps can be taken to reduce the impact of their DNS lookup.
4. Use DNS Caching
The DNS cache acts as storage holding the hostname for a set amount of time. When a browser requests the element, the cache provides the hostname instead of requiring a DNS lookup.
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:
- CNAME Records: 24 hours
- A and AAAA Records: Five minutes to an hour
- TXT Records: 12 hours
- MX Records: 12 hours
When setting up DNS caching, 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.
5. Make Use of DNS Prefetching
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.
It is easy to set up DNS prefetching, by adding the following code to the header of your single.php file (under Appearance > Theme Editor):
<!-- DNS Prefetching -->
<link rel="dns-prefetch" href="//asset1.com">
<link rel="dns-prefetch" href="//asset2.com">
Paste the code in this file either at the top or bottom, and change asset1.com and asset2.com to the links you want to prefetch. You can also add as many additional URLs as you need.
Plugins to Reduce DNS Lookups
While it is possible to manually reduce your DNS lookups in WordPress, there are plugins that can make the process easier. These plugins won’t handle every aspect of reducing DNS lookups. However, they can automate certain steps, such as using browser caching and CDN hosting.
1. WP Rocket
2. LiteSpeed Cache
GROW YOUR BUSINESS WITH GK WEB AGENCY MARKETING
As Australia’s premier digital marketing agency, GK Web Agency has a reputation for delivering marketing that works. We make the web with an team of digital marketing experts. So if you’re looking to grow your business with a stellar marketing strategy, reach out to us! We’d love to chat with you about how we can take your marketing to the next level.
Are you looking for web design?
CHOOSE YOUR INDUSTRY
- Car Dealer and Automotive
- Architect, Construction
- Building Company
- Medical Clinic, Dental, Plastic Surgeon
- Real Estate, Real Estate Agenct
- Travel Agency
- eCommerce & Online Shop
- Driving School
- Currency Exchange, Money Transfers
- FITNESS, GYM & FIGHT CLUB
- HOME DECORATION
- JOURNALIST & NEWSPAPER
- KINDERGARTEN & KIDS
- Lawyers & Legal
- MAKEUP & BEAUTY, SPA
- DOWNLOAD & UPLOAD CENTER
- ONLINE GAMES
- ONLINE MOVIE & MUSIC
- PARTY & ENTERTAINMENT
- PERSONAL WEBSITE
- PET SHOP
- PHOTOGRAPHY
- PUBLISHER
- UNIVERSITY & COLLEGE
- YELLOW PAGES & BUSINESS DIRECTORY