Sunday, July 23, 2017
Home > Website building > Editing The Hosts File

Editing The Hosts File

To set up a new  blog on a new webhost while the domain name still points to another website on another webhost, I needed to edit the host file on my Windows 10 desktop and Linux laptop. This allows me to view the new website online.

The hosts file is a computer file used by an operating system to map hostnames to IP addresses. The hosts file is a plain text file, and is conventionally named hosts. Originally, a file named HOSTS.TXT was manually maintained and made available via file sharing by Stanford Research Institute for the ARPANET membership, containing the hostnames and address of hosts as contributed for inclusion by member organizations.  https://en.wikipedia.org/wiki/Hosts_(file)

The hosts file needs to be edited as administrator:

  1. On Windows click on the start menu
  2. Type notepad
  3. Right-click on the notepad icon, click Run as administrator
  4. Click Yes
  5. Then Open… C:\Windows\System32\drivers\etc\hosts
  1. On Linux to use administrative rights to save changes to the hosts file edit it using terminal commands.
  2. For example sudo xed /etc/hosts , xed being the Linux Mint built in text editor .
  3. You have to use the terminal so you can launch the appropriate application with administrative rights.
  4. Once you’re done editing the file, hit Ctrl + X, and then y to confirm overwriting the changes.

Screenshot from 2016-09-03 12-51-49

 

Leave a Reply