Modifying your hosts file enables you to override the DNS for a domain, on that particular machine. This is useful when you want to test your site without the test link, prior to going live with SSL; verify that an alias site works, prior to DNS changes; and for other DNS-related reasons. Modifying your hosts file causes your local machine to look directly at the IP address specified.
Modifying your hosts file causes your local machine to look directly at the Internet Protocol (IP) address that you specify. TD Web Services offers managed hosting solutions to assist with the handling of these resources.
To modify the hosts file, you add two entries to the file that contains the IP address that you want the site to resolve to and the address. Adding the following two lines, for example, point www.domain.com and domain.com to our current PHP5-ITK (“Refreshed” PHP5) cluster:
220.127.116.11 domain.com www.domain.com
The sections in this article provide instructions for locating and editing the hosts file on the following operating systems:
After you add the domain information and save the file, your system begins resolving to the specified IP address. After testing is finished, remove these entries.
Windows 10, Windows 8, Windows 7, and Windows Vista use User Account Control (UAC), so Notepad must be run as Administrator.
sudo vi /etc/hosts
ip_addressproperty and enter the IP address of the other computer.
nameproperty and enter the hostname you want for the other computer.
servesproperty and select Delete from the Edit menu.
sudo nano /private/etc/hosts
The new mappings should now take effect.