Skip to main content

How to Test a Migrated WordPress Site Before Changing DNS

A Site Administrator can verify that a WordPress site is functioning correctly on Hostek servers before updating public DNS records. This process ensures that the site is fully operational, the database is correctly linked, and the content is intact...

A Site Administrator can verify that a WordPress site is functioning correctly on Hostek servers before updating public DNS records. This process ensures that the site is fully operational, the database is correctly linked, and the content is intact before the public transition.

Before you begin

You will need:

  • A WordPress site that has been migrated to Hostek.

  • Access to the local hosts file on a computer (Windows or macOS).

  • The IP address of the Hostek server where the site is hosted.

  • A browser on the local machine used for testing.

Testing the site via the local hosts file

Because the DNS has not yet been updated, the public internet cannot see the site on the new server. You must "trick" your local computer into looking at the Hostek IP address instead of the original server.

  1. Open a text editor (such as Notepad on Windows or TextEdit on macOS) as an Administrator or with root privileges.

  2. Open the hosts file. The path depends on your operating system:

    • Windows: C:\Windows\System32\drivers\\etc\hosts

    • macOS: /etc/hosts

  3. Add a new line at the bottom of the file using the following format: [Hostek IP Address] [Your Domain]

    Example: 192.0.2.10 example.com

  4. Save the file and close the editor.

Verifying the site content

Once the hosts file is updated, your browser will resolve the domain name to the Hostek IP address.

  1. Open your web browser and navigate to your domain (e.g., http://example.com).

  2. Verify that the homepage loads correctly.

  3. Click through several internal pages to ensure links are functioning.

  4. Log in to the WordPress dashboard (e.g., http://example.com/wp-admin).

  5. Confirm that the dashboard loads and that you can access the settings.

Confirm the result

The test is successful if:

  • The website loads on your local machine using the domain name.

  • The WordPress dashboard is accessible.

  • All internal links and images load from the new server.

If the site does not load or shows an error

If the site does not load or displays a "Site cannot be reached" error:

  1. Check the IP address: Ensure the IP address in your hosts file matches the IP provided by Hostek for your new server.

  2. Clear your browser cache: Your browser may be caching the old DNS information.

  3. Flush your DNS cache:

    • Windows: Open Command Prompt and type ipconfig /flushdns.

    • macOS: Open Terminal and type sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.

  4. Check the local file: Ensure there are no extra spaces or characters in the line you added to the hosts file.

Limitations

  • Local only: This test only works on the computer where you edited the hosts file. Other devices on your network will still see the old site until the DNS is updated.

  • Browser Cache: Some browsers may ignore the hosts file if they have a hard-cached DNS entry. Using an Incognito or Private window can help bypass this.

  • DNS Propagation: This procedure does not affect the actual DNS records; it only simulates the change for your local machine.

Did this answer your question?