How do I edit my host 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:
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!
Important please revert any and all changes after testing, it is very common for hosts file changes to be forgotten about. Causing connection type issues in the future.
Edit Host file For Windows 8, 8.1, 10
- Firstly, from your desktop, open the start menu.
- Using the searching feature, type Notepad.
- With the Notepad icon visible, right click Notepad and select run as administrator.
- You’re now running Notepad as administrator, click file then open.
- From here, attempt to open the hosts file by typing : c:\windows\system32\drivers\etc\hosts in the “File name:” field.
- Finally, click open to start editing the hosts file.
For 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.
- Firstly, from the desktop area press the Windows Key + R key simultaneously. This opens a run window.
- Inside the run window, enter:
- Please check that it is running at administrator level and click Ok.
- Finally, start editing your hosts file
For Windows based systems, it’s important that changes are made at the administrator level. If you experience issues, it’s possible a stage has been performed incorrectly. If you require assistance, please contact our support team who are happy to help.
Opening the host file is even simpler for macOS users, follow these steps to edit hosts.
- Open a Terminal window on your device.
- From the terminal window, type the following command: sudo vim /etc/hosts
- To enter the file just hit enter.