Setting up the hosts file when migrating a website

When we migrate sites to a new web hosting provider, we usually want to see how the site behaves on the new host, to avoid possible mistakes and downtime.

That can be done without changing the DNS of the original domain, by setting a fixed DNS record on your own computer.

This DNS record goes into the hosts file, which in Windows you will find on the system disk in Windows/System32/drivers/etc/ (in Linux it is in the /etc/ directory).

To be able to edit the file, you need to open it as a system administrator.

To do this, follow these steps:

In the Start menu open All programs and Accessories. Right click on Notepad. From the menu, select Run as administrator.

In the Notepad's horizontal menu, click File -> Open...

Search for the folder Windows/System32/Drivers/Etc/ and open the Hosts file

Write the appropriate DNS record at the end of the file in shape IP address(space)domain name (there must be a space between the IP address and the domain name)

  • If your site is located on the PHP 5.4 server, enter the IP address: 85.248.226.5
  • If your site is located on the PHP 7.0 server, enter the IP address: 85.248.226.7
  • If your site is located on the virtual server, enter the appropriate IP address.

Save the file.

WARNING: Rows starting with # are automatically ignored. The line in which you write a DNS record cannot start with #

Example:

We want to see the content of the domain www.platon.sk, which has been migrated to Platon Webhosting. So we write the following record into the hosts file: 85.248.226.5 www.platon.sk
Or, if you need them: 85.248.226.5 platon.sk 85.248.226.5 subdomain.platon.sk

Once you enter the address into your browser, you will see a version of your page that is located on the new web hosting server. This entry only applies to the computer on which it is set, so other visitors of your website will still see the original version.

After migrating and changing the DNS of the domain to new webhosting servers, please remember to delete the records listed in the hosts file. This avoids misunderstandings that might occur in the future.

helpdesk

we are ready to help

currently online

agents online 2 / 6

Platon Technologies

How can we help you?

We accept problem reports and any other feedback related to the use of our products and services.

 

helpdesk@platon.net +421 222 111 321

In case you need any help, contact us by e-mail or by phone.

  • By phone from 8:30 - 17:30
  • Sometimes even on weekends
  • Simple human approach
  • Even complex problems solved
contact form

Give our online help center a try. You will find more than:

  • 6 categories
  • 60 manuals
  • 23 e-mail settings
  • 8 programming tips
go to help center

Questions about our products or any specific request? Contact us.

We are checking whether the message is spam. Please wait...

Thanks for your message

If necessary, we will contact you.

Sending the message failed

Please contact us at helpdesk@platon.net.

NEWSLETTER

Thanks for subscribing

Subscription has failed