All Collections
Welcome to Pressidium!
Migrate your WordPress sites
How can I test my migrated site before I switch DNS?
How can I test my migrated site before I switch DNS?

You will need to edit your operating system's hosts file.

A
Written by Admin account
Updated over a week ago

The hosts file is used by your computer to map locally IP address to domain names, thus overriding external DNS lookup. It resides in different places, depending on your operating system, but its format is the same throughout. 

It is useful when you want to test a migrated website before you change your DNS entries, or go live with SSL-enabled.

You need to add an entry to your hosts file that looks like the following: (replace the values with your Pressidium IP, and domain name): 

123.123.123.123 www.domain.com domain.com

Your computer will use this IP to connect to your WordPress site without DNS. 

The following sections provide instructions for locating and editing the hosts file on several operating systems.

  • Windows 10, Windows 8, Windows 7, and Windows Vista

  • Windows NT, Windows 2000, and Windows XP

  • Linux

Note: Don't forget to remove the entry, once testing is finished. 

Windows 10, Windows 8, Windows 7, and Windows Vista

Windows 10 / 8, Windows 7, and Windows Vista use User Account Control (UAC), so Notepad must be run as Administrator.

Windows 10 / Windows 8

  1. Press the Windows key.

  2. Type Notepad in the search field.

  3. In the search results, right-click Notepad and select Run as administrator.

  4. Click Yes if prompted with a "Do you want to allow this app to make changes to your device" dialog.

  5. In Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts . You may need to select "All Files (*.*)" on the Open Dialog to be able to select the hosts file.

  6. The file already contains some lines, add your line in the end of the file in a new line.

  7. Click File > Save to save your changes.

Windows 7 and Vista

  1. Click Start > All Programs > Accessories.

  2. Right-click Notepad and select Run as administrator.

  3. Click Continue on the Windows needs your permission UAC window.

  4. When Notepad opens, click File > Open.

  5. In the File name field, type C:\Windows\System32\Drivers\etc\hosts.

  6. Click Open.

  7. If the hosts file contains entries, add yours at the bottom. 

  8. Click File > Save to save your changes.

Windows NT,  2000, and XP

  1. Click Start > All Programs > Accessories > Notepad.

  2. Click File > Open.

  3. In the File name field, type C:\Windows\System32\Drivers\etc\hosts 

  4. Click Open.

  5. If the hosts file contains entries, add yours at the bottom.

  6. Click File > Save to save your changes.

Linux

  1. Open a terminal window.

  2. Open the hosts file in a text editor (you can use any text editor) by typing the following line:  sudo nano /etc/hosts  

  3. Enter your password.

  4. The file already contains some lines, add your line in the end of the file in a new line

  5. Press Control+x.

  6. When asked if you want to save your changes, answer Yes.

Mac OS X 10.6 through 10.8

  1. Open Applications > Utilities > Terminal.

  2. Open the hosts file by typing the following line in the terminal window:  sudo nano /private/etc/hosts  

  3. Type your user password.

  4. If the hosts file contains entries, add yours at the bottom.

  5. Save it by pressing Control+x and answering Yes.

  6. Have your changes take effect by flushing the DNS cache with the following command:  dscacheutil -flushcache  

Did this answer your question?