I set a variable that points to my hosts file in my Power Shell profile, which makes it easy to edit in a text editor.
In Power Shell, type the following to open your profile: Save the file, then close and re-open Power Shell, running as administrator.
It took me a little while and a little research but I figured out how to edit the hosts file in Vista.
Non-frequent Edit Now you can edit and save the hosts file.
This is how the HOSTS file looks on a Windows 10 Technical Preview build machine: The HOSTS file may sometimes be used by malicious software such as adware, computer viruses, or trojan horses etc. For example, adding a line that translates 192.168.1.1 to “kuku”. The syntax stays mostly the same across all platforms.Most hosts files will have several entries for loopback.I also changed the regex in the split to look for any white space, not just tab.For me the biggest pain in dealing with the hosts file is remembering where it is.Each field is separated by white space (blanks or tabulation characters). For example, if you wanted to use the HOSTS file to translate a host name of a computer called “printserver” into the IP address of 192.168.0.1, you would add this line: If you ping either “printserver” or “scanserver”, you’d get to the same IP address: The HOSTS file can also translate Fully Qualified Domain Names (or FQDNs) of computers, such as ones used on the Internet. These applications may use it to redirect traffic from the intended destination to sites hosting malicious or unwanted content. That is why some Anti-Virus programs may monitor changes to the HOSTS file, preventing malicious software from modifying it. This is why many users still edit the HOSTS file and add names and IP addresses of servers, websites and other computers they frequently access to it.In Microsoft operating systems, the HOSTS file is located in the following location: Note: We also have tutorial articles on how to edit a hosts file in Windows 8, edit a hosts file in Windows 7 and on a mobile device running Windows RT.