How can I test the site on my hosting without pointing the domain name to it? (Hosts file - Windows)

How can I test the site on my hosting without pointing the domain name to it? (Hosts file - Windows)

You have probably asked yourself: How can I test my new website while keeping the old website online?

You can do that easily if you edit your HOSTS file.

Normally, when you enter a domain name in your browser, it will look for the name servers of that domain name to learn where your website is hosted. You can indicate that in the HOSTS file, preventing the browser from doing that check.

That way, even if the domain name is not registered yet, and has no name servers, or its name servers are incorrect because it is expired, or for any other reason, you can still visualize it from your browser.

This tutorial only applies for Windows users. Click on the link If you would like to edit your HOSTS file in Mac

  1. Open your HOSTS file in admin mode.

    1. Locate your Notepad, right-click on it and select Run as Administrator.

      Notepad

      Run as Administrator

    2. As an Administrator, open the following file: C:\Windows\System32\Drivers\etc\hosts

      Open

      All files

      hosts

  2. Edit your HOSTS file. For each domain name you need a single line, which consists of the IP followed by all hosts you want to direct to that IP address, divided by a single space. Check the example bellow:

    xxx.xxx.xxx.xxx webhosting.be www.webhosting.be ssh.webhosting.be

    hostsline

  3. Save

    1. Click on File > Save to save your changes

      Save

    2. Now click on File > Exit to exit the file safely

      Exit

  4. Test

SSD Hosting: your website or web store up to 20 times faster!

  • 24/7 free support and domain name
  • Money back guarantee
  • User-friendly control panel
More information?

Couldn't find a solution?

Our team is available 24/7 to provide you with free assistance. Feel free to contact our collaborators, free of charge, via e-mail or telephone.

0800-8-5678