Following are the steps to modify the host file in Windows 7, MacOS and Ubuntu.
Windows 7 :
Note: You can also use these steps to modify the host file in Windows 8/10 as well.
- Press Windows+R to open Run.
- Enter Below Command to open host file in notepad.
- Modify the required line and save your changes.
We will use nano editor to modify host file in ubuntu. You can use your favorite editor. You can find host file at path /etc/ folder. We logged in as root user here. You can use sudo if you are not logged in with root user.
- Hit below command.
# nano /etc/hosts
- Modify the Required line and save your settings by ctr+x Button. Press Y to complete save changes.
Mac OS X :
You will find the host file in MAC OS at the same path as we see in Ubuntu.
- Open a GUI Text Editor.
- Access the file at /etc/ folder using below command.
# vim /etc/hosts
- Modify your changes and save the Host file.