How to Edit Host File in Windows, Linux and Mac? The computer file hosts is an operating system file that maps hostnames to IP addresses. It is a plain text file. 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. The Domain Name System, first described in 1983 and implemented in 1984, automated the publication process and provided instantaneous and dynamic hostname resolution in the rapidly growing network. In modern operating systems, the hosts file remains an alternative name resolution mechanism, configurable often as part of facilities such as the Name Service Switch as either the primary method or as a fallback method.
How to Edit Host File in Windows?
There are two methods to edit host file in Windows, as listed below.
Method #1: Using Hosts File Editor (Simple)
Seamlessly edit host files, create backups for easy retrieval or create entirely new ones using this simple and straightforward tool. Whether you have been the victim of a malware attack or perhaps somebody played a prank on you, there are times when you need to make modifications to the host files on your computer. Hosts File Editor is a small utility that enables you to effortlessly and freely manage the access to websites and network traffic by editing the host files.
Prerequisitie
- Microsoft .NET Framework 4.0 Client Profile
Software Info.
Software Name | Hosts File Editor |
---|---|
Platform(s) Suppoted | Windows |
Developer | Nebojsa Vucinic – Trebinje |
Size | 1.7 MB |
Price | Free |
Method #2: Manual Edit Hosts File
1. Press + R to open Run program and type Notepad
in it.
2. Go to File > Open and Navigate to c:\Windows\System32\Drivers\etc\hosts
.
3. Add you codes/lines in the end of the file.
4. Save it.
How to Edit Host File in Linux?
1. Open up terminal and put below command in it.
sudo nano /etc/hosts
2. Enter your password for Linux
3. Add you codes/lines in the end of the file.
4. Press CTRL + X and then type Y to Save file.
How to Edit Host File in MacOS?
1. Open up terminal and put below command in it.
sudo nano /private/etc/hosts
2. Enter your password for Linux
3. Add you codes/lines in the end of the file.
4. Press CTRL + X and then type Y to Save file.
5. To Make your changes take effect, enter below command.
dscacheutil -flushcache