• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • AI Agents
    • OpenClaw
    • Claude Code
    • n8n
    • Hermes Agent
    • Open WebUI
    • Docker
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
    • Email Hosting
    • HeroicGuard
    • GPU Hosting
    • Website Builder
  • VPS
    • Managed VPS
    • Unmanaged VPS
    • Flex VPS
  • Reseller
  • Gaming
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

Test Your Site On A New Host Before Changing Your DNS Records

Bhagwad Park

Published on: November 8, 2021

Categories: Website Development 0

Over the past few days, I’ve ended up migrating my site to a NameHero VPS. And in all this, I’ve found the absolute best way to test your site on the new server before you change your DNS records.

The Problem

Making the final switch of your DNS records is an act of faith. You have to be absolutely sure that your site is working properly on the new host before you leap. Otherwise, your visitors will experience downtime, and you’ll have to revert your DNS changes, which can take a lot of time to propagate, leading to an absolute mess.

But how do you test it? After all, the internal links of your site will all point to its own domain – not to an IP address. So even if your web host has given you a temporary URL to which you can point your web browser and see your homepage, it’s not going to work the moment you click a link on it.

What we’re looking for, is a system that will resolve your site’s name to the new IP address – but only for you and no one else. There are a few online services that accomplish this, but nothing beats modifying your system’s hosts file.

Here’s how you do it.

Step 1: Open Notepad as an Administrator

The file we’ll be modifying requires escalated privileges to edit. So go to your start menu on Windows, and right-click Notepad, and select “Run as administrator” like this:

Open Notepad as an Administrator
Open Notepad as an Administrator

This way when you make your changes, you won’t get an “Access Denied” message. If you’re using another editor program, then of course search for that instead.

Step 2: Open the Hosts File

Using your file editor that you just opened in admin mode, open the following location on Windows:

C:/Windows/System32/drivers/etc/hosts

On Mac, it should be here:

/private/etc/hosts

This should open up the file in your note program for editing.

Step 3: Add the New IP Address (Temporarily)

In the next stage, add one line in this format:

[new IP address] [domain.com] [www.domain.com]

For example, when I migrated my site WP-Tweaks to NameHero, I used the following entry:

12.34.56.857 wp-tweaks.com www.wp-tweaks.com

Where “12.34.56.857” was the IP address of my new VPS server. This ensures that both wp-tweaks.com and www.wp-tweaks.com resolve to my new NameHero IP address on my local machine.

Step 4: Clearing your Browser Caches

Browsers store the results of their DNS lookups, so they won’t immediately see the change in your hosts file. You need to manually clear the DNS cache. Here’ how you do it.

Clearing the DNS Cache on Chrome

With Chrome, type the following address into the URL bar:

chrome://net-internals/#dns

From here, you can clear the host cache by clicking the button as shown here:

Clear DNS Cache on Chrome
Clear DNS Cache on Chrome

This should clear out your DNS cache on Chrome.

Clearing the DNS Cache on Firefox

To clear the DNS cache on Firefox, navigate to:

about:networking#dns

And now just click “Clear DNS Cache” like this:

Clear DNS Cache on Firefox
Clear DNS Cache on Firefox

After this, you can even click the “DNS Lookup” tab and check that it’s showing the new IP address.

Step 5: Browse the Site on your New Server

Now when you navigate to your site via the URL, it should point to the new server. From here, you can do everything you would normally do. Literally everything. You can go to the dashboard, check backups. In short, you have a perfect way of making sure that your website works flawlessly. I’ve written before about the best way to migrate a WordPress site to a new host using the All-in-One WP migration plugin.

Step 6: Don’t Forget to Change Back your hosts File Afterward!

Once you’re all ready to party, revert the changes to your hosts file and flush the caches on your browser. Now you’re ready to finally change the DNS entries. Good luck!

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

How to Start an Online Store Without Inventory

Let's discuss the benefits of launching a store without inventory and look at some options. We’ll then show you how to sell products online.

How to Create A Lead Capture Page That Converts

In this post, we’ll show you what makes a great lead capture page and how you can easily build your own.

How to Create a SaaS Landing Page

In this post, we’ll break down the components of a high-converting SaaS landing page. We’ll then show you how to create one for your product.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • OpenClaw Hosting
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • Managed VPS Hosting
  • Unmanaged VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • GPU Hosting
  • Email Hosting
  • HeroicGuard
  • Domains
  • Website Builder
  • AI Agent Hosting
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2026 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA