Skip to main content

How to Test a Migrated Website Before Changing Public DNS

You can verify that your website files and database are functioning correctly on Hostek's servers before you point your public DNS records to the new location. This process ensures a smooth transition and minimizes potential downtime during the cutover.

Important: This testing process involves viewing the site on the Hostek server while it is not yet live to the public. Ensure you have a local copy of your site or a staging environment if you need to maintain a live site during this transition.

Before you begin

You will need:

  • A Hostek account with a prepared migration destination.

  • Access to the website's files and database on the Hostek server.

  • A local computer with a web browser.

  • The IP address or temporary hostname provided by Hostek for your migration destination.

Testing the site via the local hosts file

You can "trick" your local computer into looking at the Hostek server instead of the original host by editing your computer's local hosts file. This allows you to see the site as it will appear once the DNS change is complete.

  1. Identify the Hostek IP address. Locate the IP address or temporary hostname provided by Hostek for your migration.

  2. Open your system's hosts file.

    • Windows: Open Notepad as an Administrator and open C:\Windows\System32\drivers\etc\hosts.

    • macOS/Linux: Open the Terminal and use a text editor (like nano or vi) to open /etc/hosts.

  3. Add the entry. Add a new line at the bottom of the file using the following format: 123.456.78.90 www.example.com (Replace 123.456.78.90 with your Hostek IP and www.example.com with your actual domain.)

  4. Save the file. Save the changes and close the editor.

  5. Clear your browser cache. Clear your browser's cache or open a private/incognito window to ensure you are viewing the fresh version of the site.

  6. Visit your website. Enter your domain name into your browser.

Confirm the result

The site should load from the Hostek server. You can verify this by:

  • Checking that all pages load correctly.

  • Verifying that internal links and images load properly.

  • Confirming that the database content (such as blog posts or product listings) is current.

If the site does not load or shows an error

If the site does not load or displays a "Site Not Found" error:

  • Check the IP address: Ensure the IP address in your hosts file is correct.

  • Check the domain name: Ensure you included both the www and non-www versions if applicable.

  • Flush your DNS: On Windows, run ipconfig /flushdns in the Command Prompt. On macOS, restart your system's DNS service or restart your computer.

Limitations

  • Local only: Changes made to the local hosts file only affect the computer you are currently using. They do not affect how other users see your website.

  • Browser caching: Some browsers may still show the old version of the site if the cache is not cleared.

  • DNS Propagation: This method bypasses DNS propagation. If you see issues after you eventually change your public DNS, the issue may be related to propagation or a configuration error on the Hostek server.

Did this answer your question?