How to Reduce DNS Lookup in Wordpress Blog


#1

Hey,Recently I am optimize my blog and their GTMATRIX Score is Good 98% but in Yslow score I am seeing that Reduce DNS Lookup..!!

Can this is increase my server response time…??

How to Reduce DNS lookup of my website…???

Please provide some step by step guide or plugins…??


#2

As long as u r using Google adsense, u cannot do much to reduce DNS lookups. There will be many DNS lookups to load the ads.

However, one factor which i have found beneficial to load adsense ads faster is to use DNS prefetching. So i prefetch the top 4 urls of google such as pagead2.googlesyndication.com etc

Please read online on what plugins to use for dns prefetching as i use a pro plugin to do the same. OR @GulshanKumar can help u with that.


#3

To reduce DNS lookup impact, you can use DNS Prefetch resource hint markup. This allow browser to pre-resolve DNS lookup.

Browser Supports


Data source: Caniuse

Implementation in WordPress
WordPress may add sometime, however few domains may goes missing.

Use Genesis Hooks Plugins genesis_doctype field markup to add properly.

Alternatively, you may use below snippet in theme functions.php file.

function gk_dns_prefetch() {
    echo '<meta http-equiv="x-dns-prefetch-control" content="on">
<link rel="dns-prefetch" href="//fonts.googleapis.com" />
<link rel="dns-prefetch" href="//cdn.onesignal.com" />
// Adding few more
<link rel="dns-prefetch" href="//stats.wp.com" />';
}
add_action('wp_head', 'gk_dns_prefetch', 0);

Performance Gain
It can be noted in Browser network timeline.


#4

Thanks @GulshanKumar, I hop This is helpful for me…!!


#5

You’re welcome! :slight_smile:


#7

I have few doubts in DNS and please someone clarify my doubts.

1.)
Shall We Add the TTL for DNS in the following order
A Record at 43200
CNAME Record at 86400

2.)
Domain Registrar was ResellerClub but enabled with Cloudflare DNS only.
Which DNS Service will take the effect?

3.)
Also, we have a DNS function in our Webserver as well. Does changing values in those records have any effect?


#8
  1. In case you want to change hosting, you may need to wait longer for the DNS propagation. So, a lowest TTL is generally preferred. If you are confident with your host, you may keep longer.

  2. The nameservers which you are using - Cloudflare DNS will be active.

  3. Nothing impact. Just make sure all DNS records are present as before.


#9

What DNS service are you currently using brother?


#10

Using Cloudflare.