September 8, 2026

Career Flyes

Fly With Success

How to Reduce DNS Lookups in WordPress for Faster Page Loads

6 min read

Reduce DNS lookups by using fewer outside services, fewer hostnames, and smarter loading rules. That is the quick win. Every extra domain your WordPress site calls can add a small delay. Stack enough of them, and your page starts to feel like it is waiting in line at the DMV.

TLDR: DNS lookups happen when a browser finds the server behind a domain name. Fewer domains usually means faster page loads. For example, a WooCommerce blog cut external hostnames from 23 to 9 and trimmed about 420 ms from mobile load time. Its Largest Contentful Paint improved by 18%, which is a nice little speed win for one afternoon of cleanup.

What Is a DNS Lookup?

A DNS lookup is like asking for directions.

Your browser sees a domain, such as fonts.googleapis.com. It then asks, “Where does this live?” DNS answers with an IP address. Only then can the browser fetch the file.

One lookup is fine. Ten can be okay. Thirty gets silly.

WordPress sites often collect outside requests over time. A font here. A tracking script there. A chat widget. A video embed. A social feed. Then one day the homepage needs to visit half the internet before it can load.

Honestly, it feels like plugins invite their cousins to dinner and forget to tell you.

Why DNS Lookups Slow Down WordPress

Browsers are fast. But they still follow steps.

  • Find the domain.
  • Open a connection.
  • Request the file.
  • Download it.
  • Use it on the page.

DNS is only one step. Yet it comes early. If the browser is stuck finding domains, everything after that waits.

This hurts most on mobile. It also hurts on slow networks. A DNS lookup may take 20 ms. It may take 200 ms. With many third-party domains, the delay adds up fast.

First, Find Your DNS Lookups

Do not guess. Test first.

Use one of these tools:

  • Chrome DevTools: Open the Network tab. Reload the page. Look at the Domain column.
  • WebPageTest: Great for seeing connection timing and request chains.
  • GTmetrix: Helpful for spotting third-party files.
  • PageSpeed Insights: Good for Core Web Vitals clues.

Make a simple list of domains your page uses. Group them like this:

  • Your site: example.com, www.example.com
  • CDN: cdn.example.com
  • Fonts: Google Fonts, Adobe Fonts
  • Analytics: Google Analytics, Tag Manager, pixels
  • Media: YouTube, Vimeo, maps
  • Widgets: chat, reviews, social feeds

Now comes the fun part. Delete the junk.

1. Remove Plugins That Add Outside Requests

Many plugins load scripts from their own servers. Some do it on every page. Even when the feature appears on one page only. That is annoying.

Check plugins for these common offenders:

  • Live chat boxes
  • Social sharing buttons
  • Review badges
  • Popups
  • Marketing pixels
  • Form spam tools
  • Calendar embeds

If a plugin adds one button but loads six domains, ask if you really need it. Replace it with a lighter option. Or load it only where needed.

For example, a booking widget belongs on the booking page. Not on every blog post about tomato soup.

2. Host Fonts Locally

Fonts are a common DNS lookup source.

Google Fonts often call domains like:

  • fonts.googleapis.com
  • fonts.gstatic.com

That means extra lookups. You can avoid them by hosting fonts on your own server.

Use fewer font families. Use fewer weights. A site rarely needs regular, medium, semi bold, bold, extra bold, italic, and “fancy but unreadable.”

A smart setup:

  • One font family for body text.
  • One font family for headings, if needed.
  • Two or three weights total.
  • Use WOFF2 files.

Some performance plugins can host Google Fonts locally. You can also do it by uploading font files and adding CSS.

3. Use Fewer Tracking Scripts

Tracking scripts multiply fast.

You start with Google Analytics. Then you add Google Tag Manager. Then Meta Pixel. Then TikTok Pixel. Then Hotjar. Then a heatmap. Then an A/B testing tool. Soon your homepage is wearing a backpack full of bricks.

Keep what you use. Remove what you forgot.

Ask these questions:

  • Did we check this data in the last 30 days?
  • Does this script help us earn money?
  • Can this tool be loaded after user consent?
  • Can it be limited to certain pages?

If not, cut it.

4. Replace Heavy Embeds With Click-to-Load

Videos, maps, and social feeds can be DNS monsters.

A YouTube embed may call several domains before the visitor even presses play. Google Maps can do the same. Social feeds are often worse.

Use a preview instead.

Show an image thumbnail. Add a play button. Load the real embed only after the user clicks. This keeps the first page load clean.

This works well for:

  • YouTube videos
  • Vimeo videos
  • Google Maps
  • Instagram feeds
  • Facebook widgets

The page feels faster. The user still gets the content. Everybody wins. Even your poor server gets a nicer day.

5. Use DNS Prefetch for Domains You Must Keep

Sometimes you cannot remove a third-party domain. Fine. Tell the browser to prepare early.

DNS prefetch asks the browser to resolve a domain before it is needed.

Example:

<link rel="dns-prefetch" href="//www.google-analytics.com">

This does not remove the lookup. It just starts it sooner.

Use it for key outside domains, such as analytics or payment tools. Do not add prefetch for every random domain. That can create noise.

6. Use Preconnect for Critical Third-Party Files

Preconnect goes one step further than DNS prefetch.

It starts the DNS lookup, TCP connection, and TLS handshake early. That helps when an external file is critical.

Example:

<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

Use preconnect carefully. Pick only the most vital domains. Two or three is plenty for most sites.

If you preconnect to twenty domains, you are not optimizing. You are throwing spaghetti at the browser.

7. Move Files to Your Own Domain or CDN

If files are safe to host yourself, do it.

This can apply to:

  • Fonts
  • Small JavaScript files
  • CSS files
  • Images
  • Icons

A CDN can also help. But keep it simple. One CDN hostname is better than files spread across many domains.

Try to avoid mixing assets across your main domain, a CDN domain, a plugin domain, and three marketing domains unless there is a real reason.

8. Disable Scripts on Pages That Do Not Need Them

This is a huge WordPress win.

Some plugins load everywhere. Contact form scripts load on the homepage. Slider files load on blog posts. WooCommerce cart fragments load on pages with no products.

It drives me crazy that one tiny form can drag its entire toolbox across the whole site.

Use an asset manager plugin to unload scripts by page. Popular options include performance plugins with script control features. You can also do it with custom code, if you are comfortable.

Good targets:

  • Load contact form scripts only on contact pages.
  • Load checkout scripts only on shop pages.
  • Load slider scripts only where sliders appear.
  • Load gallery scripts only on gallery pages.

9. Clean Up Your Theme

Themes can add extra DNS lookups too.

Some themes load icons, fonts, demos, tracking, or scripts from outside sources. Check your theme settings. Turn off what you do not use.

Use system fonts if you want the fastest route. They need no font download and no font DNS lookup.

Example system font stack:

font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

It is not exotic. It is fast. Fast is beautiful.

Quick Checklist

  • Audit domains in Chrome DevTools or WebPageTest.
  • Remove unused plugins and old tracking tags.
  • Host fonts locally or use system fonts.
  • Use click-to-load for videos, maps, and feeds.
  • Add DNS prefetch for useful third-party domains.
  • Add preconnect only for critical domains.
  • Unload scripts on pages that do not need them.
  • Retest after each change.

What Result Should You Expect?

Do not expect magic from one tiny fix. Expect steady gains.

If your site has only five external domains, DNS cleanup may save a little. If it has thirty, the improvement can be obvious. Large plugin-heavy WordPress sites often see faster first load, better mobile scores, and cleaner request charts.

A good target is simple: keep third-party hostnames as low as possible. Under 10 is nice. Under 5 is lovely. Zero is rare, unless your site lives in a cave and eats plain HTML for breakfast.

Start with the worst offenders. Remove what you do not need. Delay what can wait. Prepare what must stay.

Your WordPress site will load faster. Your visitors will feel it. And your browser will stop sprinting all over the web just to show one page.