Saturday, 13 September 2014

How to modify my hosts file?

Modifying your hosts file will allow you to override the DNS for a domain, on that particular machine. This can be used to test your site without the test link, prior to going live with SSL, verify an alias site works prior to DNS changes, or for other DNS related reasons. This causes your local machine only to look directly at the IP specified.


Your hosts file will need to have two entries added that will contain the IP address you want the site to resolve to and the address. Adding the below two lines for example will point www.domain.com and domain.com to our current PHP5-ITK ("Refreshed" PHP5) cluster:


1.2.3.4 www.domain.com
1.2.3.4 domain.com


Below is how to locate and edit the hosts file on several OS platforms. Once the proper domain information is added you will save the file and your system will begin resolving to the specified IP. Once testing is finished these entries should be removed.


Contents:-   
Windows Vista and Windows 7
Windows NT/2000/XP
Linux
Mac OSX 10.0 - 10.1.5
Mac OSX 10.6 - 10.8


 


 

No comments:

Post a Comment