Saturday, June 19, 2021

Reduce and Speed ​​Up DNS Lookups

  When it comes to WordPress, you can see that there are tons of different optimizations. Which has been published through DNS Lookup. One factor that is often overlooked is the look times associated with DNS. This is an important part of the puzzle when it comes to calculating the total page bar of a page. So today we will learn how to reduce DNS lookups. How can I speed them up? This affects the performance of your WordPress site in this way. I am going to know some detailed advice about him.

Tips on How to Reduce and Speed ​​Up DNS Lookups

What is DNS lookups?

Before you know what a DNS lookup is, you need to know what DNS is and how DNS works. DNS (Domain Name System) is basically a phonebook of the Internet. When we type a domain name using a web browser, such as Google.com or Facebook.com, into the search bar, DNS finds the correct IP for those sites. The browser then uses these addresses to communicate with the original addresses or CDN edge servers to access the web site information. This is thanks to the DNS server: DNS dedicated to answering questions.

An easy way to explain how DNS works is to think of it as a phone book on the Internet. Find out the exact IP (domain name) address of the website and domain you visited.

Whenever you like any browser or search engine. Less in Tackle Club, the DNS issue is created with your own ISP to ask the actual title machines associated with the site. The actual IP tackle is performed behind the actual moments using the assigned server. So that you can use the name of the website for it. Without DNS, a person needs to do something similar to 218. Eighty Fifty. 219. 207 to get into search engines. Which will not be enjoyable.

Whenever you enter a website, the DNS research is asked before any site, for each site actually needs to be loaded. However, DNS research does not have to be driven by every source. So, for example, let's imagine the next HTTP claims now:

Despite a few fully associated with 8 HTTP claims, only 3 are fully associated with individual domain names. That means you get 3 DNS lookups.

DNS links in the pingdom

How the above curriculum will appear in the pingdom speed test equipment. It is shown below. DNS is presented as a pink bar and is measured in MS. The first time you run your website through Pingdom, you see the new look. To get IP information you need to ask for the DNS record of each domain. Note that you do not need to ask for DNS more than once in the CDN.upidev.inc domain. This is how DNS works. You only need to ask a domain once. There are a total of 8 requests below. but only 3 DNS lookups.

These DNS searches generate extra load time, so it can't load anything until the DNS lookup is finished. Notice below that the DNS secretly in the CDN URL took more than 310 ms. This does not include searches on wpdev.ink or js.stripe.com. So you will see how it can be associated with time.

When your website is go through Pingdom more than once. It then stores the DNS because it already knows the IP information and does not have to search again. This is why your website appears faster after running Pingdom more than once. And as you can see from the next screen, in the second test, the time to view the DNS in the CDN URL is 0 ms. This is an area that many people misunderstand. But don’t worry, we’ll dive deeper into the DNS cache below.

DNS lookups in GTmetrix

Each website's speed testing tool works somewhat differently in the field. Almost all of these count for you when viewing DNS. Shows how similar requests will appear in GTmetrix. DNS is presented as a green bar and measured in MS.

DNS lookups on Web Page test

Here is an example using web page test. They have a quick summary of the details of the request and you can click on the "DNS Lookup" column. You can filter it based on the maximum response bar. We ran usatoday.com through the tool as an example, and the DNS viewing time took 5.2 seconds.

It is quite common for all these news websites not to be highly optimized for all their external requests. However, as you can see, the DNS hiding time of your web site probably took longer than most people loaded the entire site. This is why the issue of DNS is so important.

How to reduce and speed up DNS lookups

You will now learn more about how DNS works. Here's how to speed up DNS lookups on your WordPress site. Show some recommendations about it. This is sometimes also known as a "minimized DNS lookup" in motion test equipment.

Tips 1 Use a quick DNS provider

It is important to note that there are faster and slower DNS providers along with hosting. So That should be one of the first things to fix.

Usually the free DNS provided by domain registrars like Bluehost, GoDaddy and Namecheap is very slow. Usually DNS providers act like CDNs and have multiple POPs around the world. Many DNS providers, such as Amazon, Cloudflare, Dine, and DNS Made Easy, have a wide range of DNS infrastructure specifically designed for low-latency environments.

We conducted some experiments to compare the speeds of some popular DNS providers. We used the SolvDNS, speed test of the KCDN functionality tool and averaged it. Speed ​​was measured from multiple locations around the world. As you can see, with the exception of Cloudflare, free DNS providers are certainly slow. This is why if you are serious about your business and website. However we recommend going with a premium DNS provider.

Some suppliers are also faster than others in certain regions. Because they are important to determine where you need to be when viewing regional or global fast DNS. DNSPF is a new DNS speed comparison tool. You can use it when choosing a provider. Did you know that you can also use CloudFlare DNS without CDN functionality?

Tips 2. Quick change TTL values ​​to take advantage of DNS cache

As I said before, you don't have to worry about loading each page because of the DNS cache. How your WordPress site is cached and how it works in DNS cache. It uses the DNS cache until it expires. The duration of the DNS cache is therefore determined by what they call the survival time (TTL) value.The higher the TTL, the less likely it is that browsers or search engines will have to look up another DNS.

To improve your DNS cache bar you need to change the TTL values ​​with the domain registrar or third party DNS provider. It is important to note that Internet service providers also do DNS caching. Here are some common TTL values.

  • 300 seconds = 5 minutes
  • 1800 seconds = 30 minutes
  • 3600 seconds = 1 hour
  • 43200 seconds = 12 hours
  • 86400 seconds = 24 hours

TTL values ​​are typically used within 30 minutes to an hour. But some have set their TTL very low to allow for quick updates. So CloudFlare is an example of 5 minutes default if you use its automatic TTL. It can also be useful to look at different types of DNS records and set them according to the frequency of change. Here is an example:

  • A and YYYY records: Better to change more often in 5 minutes to an hour
  • CNM records: These rarely change, usually a higher TTL is better 24 hours
  • NS records: These rarely change, higher TTLs like 24 hours are usually better.
  • MX Records: Change less frequently, a high TTL like 12 hours is usually good

TXT Records: Change less frequently and a high TTL like 12 hours usually has no real right or wrong answer when it comes to good TTL. However, you can improve your DNS viewing time by choosing a TTL and match the frequency of changes to your site.

Tips 3. Reduce the number of domains (hostname)

Shrink your site's DNS lookups and the easiest way is to separate the requests and look for different hosting names. Remember that DNS lookups are not about the number of requests, but about the number of different domains that run your WordPress site through tools like Pingdom.Determine if each request is really necessary. Since mapping the name of a hosting to a DNS IP address. So you might be wondering why only people point to an IP address instead? The IP address may change frequently. Because there will be no hosting names.

Tips 4. Use alternative services, including Quick DNS

It is easier said than done with the reduction of the number of domains (host-name) that we recommend looking first with the longest DNS lookup bar. For example, on this site we checked below and we can easily see that the time spent looking at DNS for Crazy Egg Crawl script was much longer than others. So it’s probably because your DNS provider isn’t as fast as anyone else’s.

This is a scene where you can probably keep an eye on other providers like Hotzer. Providing the same service however you are probably using a faster DNS provider. When adding external services to your WordPress site it can be very important that you evaluate their functionality.

Tips 5. Remove and host resources on a CDN

An easy way to reduce DNS lookups is to remove as many resources as possible from your CDN provider. If you run your site through Pingdom and you see the total number of domain requests. As you can see in this example, 94.3% of requests are for CDN URLs.There is a request for hosting which is one to Google Analytics. By removing as many resources as possible in the CDN and reducing the number of DNS lookups you have involved and thus reducing load time.

Now of course it will not always be possible to move to your CDN and there will always be some external resources or services that you need to load them from their server. So we recommend visiting their website. Many times we find that WordPress users are not properly hosted on CDN. You can also take advantage of HTTP / 2 and parallelism. There are some resources here and we often see that it can be improved:

Sometimes we see developers of plugins and themes that include Font Surprise on WordPress sites. But sometimes they line them up like that and by default plugins like CDN Enabler don't take it. In this case, we suggest contacting the developer to ask how we can upload from your CDN.

Font Awesome

Font is another common situation with surprises. so It is sometimes loaded from the default BootstrapCDN (MaxCDN). There is nothing wrong with that and you don't need it. It adds another DNS lookup. In most cases loading the font surprise from your own CDN. It would be better if there is no other search.

Gravators

If you use local WordPress comments. However, there may be additional searches for safe.gravator.com to load your serious ones. An easy solution to this problem may be to use the Lazy Loading Comments plugin. While this won't reduce DNS lookups, it will delay until the user scrolls through the page.So, in a sense, you are reducing the load of the first page DNS lookup and be sure to check out our blog for other ways to speed up the comments.

Google Font

Fighting downtime and WordPress issues? Kinsta is a hosting solution designed to save you time! Check out our features.

Search fouts.googleapis.com to capture your CNS file with Google Fonts. DNS has an additional request. Then download the font files. You have additional requests at fonts.gstatic.com. When you're hosting all requests locally from the same domain or CDN and you probably won't need any other CSS files. Because it will be in the CSS file of your WordPress theme. There are opinions in favor of doing this, but take a look at our in-depth article on font hosting locally.

The fonts are amazing, Gravators and Google fonts make sure your CDN is loading. How you can compress DNS lookup. Here are some examples: Are you currently loading everything possible from your CDN? Good to see you once.

Tips 6. Take advantage of DNS prefetching

So another suggestion to speed up DNS is to use DNS prefetching. This allows the browser to perform a DNS lookup on a page in the background. You can do this by adding a few line codes to your WordPress site title at once. Below are some examples:

  • <! - Prefetch DNS for external resources ->
  • <Link rel = "dns-prefetch" href = "// fouts.googleapis.com">
  • <Link rel = "dns-prefetch" href = "// www.google-analytics.com">
  • <Link rel = "dns-prefetch" href = "// cdn.domain.com">

DNS prefetching does not work on iOS Safari, Opera Mini and Android browsers and is supported by all major browsers.

Or if you are running WordPress version 5.6 or later. However you may want to use resource hints. Developers can use the wp_resource_hints filter to add URLs to custom domains for DNS-Prefetch, Pre-Connect, Prefetch, or Prerender.

Tips 7. Stop loading JavaScript

If JavaScript loading is isolated and the document is not fully loaded, this may prevent things from being loaded. This will not reduce the number of DNS lookups required. However, this will prevent them from calling immediately. Which can speed up the user experience.

Vervier has a great explanation of how to suspend JavaScript. There is no reason to load the top of the furnace, so the example you use on your site is like your Google Analytics script.

Stop loading JavaScript in WordPress and you can use a free plugin like Asynchronous JavaScript. But it is important to know that you will probably have to go through the list and scripts that you want to avoid falling behind. Why? Because there are some JavaScript that will appear above the fold. However, it is fully compatible with the Asynchron JavaScript Autoptimize plugin.

Also check out our in-depth post on how to remove JavaScript and CSS display blockers.

Tips 8. Take advantage of AIM records and CNAME flattening

There are additional records from providers like DNS Made Easy and CloudFlare and that can help reduce the number of requests in the backend.

ANAME Records with DNS Made Easy

ANAME Records gives you the functionality of CNAME Records and at the core level. So, for example, you have a CNAME set for www.domain.com. Www must first resolve the hostname and then the IP address.

So it requires two requests. An AIM record allows you to avoid one of these requests. Properly installed, they can be used in combination with CDN.

CNAME

ANSWER SECTION:

www.domain.com. 1799 IN CNAME domain.com.

domain.com. 1799 IN A 192.168.0.2

ANAME

ANSWER SECTION:

www.domain.com। 1799 এ এ 192.168.1.2

However this may not always be true, if the hostname is in the same DNS zone and the A record can be restored with the same request.

CNAME flattening with cloudflare

In the case of CNAME records such as Cloudflare provides automatic CML flattening in the top (or core) zone for its clients.

Resume

DNS is often a cause of neglected performance. But if you are not careful, it can easily contribute to a large part of your overall load time. Understanding how DNS works, there are faster and slower providers, and how you can slow down searches on your site is important.

Do you have additional tips to speed up and slow down DNS lookups? If so, we look forward to hearing from you later in the comments!


No comments:

Post a Comment