Edit the hosts file

The most common reason to edit the host file is to test a website before changing the ‘live DNS’ to complete a migration.  To do this, you should add lines as shown below:

x.x.x.x mydomain.com

x.x.x.x www.mydomain.com

Replace ‘x.x.x.x’ the IP address of your service with ourselves, and mydomain.com with the domain for which you wish to override the ‘live DNS’.

Remember to remove these lines once you have completed the testing and migrated!

Windows 8, 8.1, 10

1. Firstly, from your desktop, open the start menu.

2. Using the searching feature, type Notepad.

3. With the Notepad icon visible, right-click Notepad and select run as Administrator.

4. You’re now running Notepad as administrator, click the file then open.

5. From here, open the hosts file by typing the following in the File name: field.

c:\windows\system32\drivers\etc\hosts
.

6. Finally, click open to start editing the hosts file.

Windows 7

Fortunately, the number of steps is reduced due to how this operating system works. However, please ensure that the application is run as administrator.

1. Firstly, from the desktop area press the Windows Key + R key simultaneously. This opens a run window.

2. Inside the run window, enter the text below.

notepad c:\windows\system32\drivers\etc\hosts
.

3. Please check that it is running at the administrator level and click OK.

4. Finally, start editing your hosts file.

MacOS

Opening the host file is even simpler for macOS users, follow these steps to edit hosts.

1. Open a Terminal window on your device. 

2. From the terminal window, type the following command:.

sudo vim /etc/hosts
.

3. To enter the file just hit enter.