Customer Support

  1. Support
  2. How can I see my site (sitepreview) before I update the nameservers ? Linux Host file

How can I see my site (sitepreview) before I update the nameservers ? Linux Host file

In case of transfer of your site from another company to Top.Host, but also in case of internal transfer of your site, from one server of Top.Host to another before proceeding to the declaration of the servers through your registrar, you can modify the hosts file of your computer and according to this modification your computer will see the new server and not the one from which the site is online.


This process consists of the following simple steps.


Step 1 : Run a command to write the hosts file with sudo rights


Open the terminal and run the following command:
sudo vi /etc/hosts


Then enter your password.


Step 2 Add records:


Enter the following commands in the hosts file, below the line


# 127.0.0.1 localhost
209.85.112.207 top.host
209.85.112.207 www.top.host


where 209.85.112.207 is a random IP (you will declare the IP of your server) and where top.host you will declare your own domain.


Save your changes by typing :wq and click Enter


Open your sites in a new browser (mozilla firefox, Google chrome, Internet explorer) and proceed with the necessary checks on your part.


Step 3: Restore hosts file to its original format:


Open a terminal and execute the following command:


sudo vi /etc/hosts


Then state your password and delete the commands you had entered initially. Save your changes by typing :wq and click Enter.

You haven't found what you are looking for?

Contact our experts, they will be happy to help!

Contact us