http://www.sysprobs.com/how-to-edit-host-file-in-windows-8-1-8


This guide shows you how to edit hosts file in Windows 10 and Windows 8.1 easily without any additional system tools. Hosts file is an important system file which maps the host/site names with it’s IP addresses. Basically it translates the host name to IP and IP to host name. So the browsing and accessing other network places/shares by ‘name’ will be smoother by avoiding DNS server requests. We can manually customize DNS name and IP address for specific sites in this file which will be helpful in several ways in Windows or Mac OS X. Hosts file is a plain text file without any file extension.

We used to modify the hosts file by ‘edit’  DOS command in earlier Windows operating systems, but the edit DOS command is not included in Windows 8.1 and 10. You would be getting the following error message when you try edit command in Windows 10/8.1 command prompt.

“ ‘edit’ is not recognized as an internal or external command, operable program or batch file.”

edit command error

This is because of edit DOS command requires 16-bit QBASIC.EXE and it will not work on 64Bit version of Windows 8.1 and Windows 10. So how to edit the hosts file here?, we can use the built-in Notepad program for this purpose.

Let us Easily Edit the Hosts File in Windows 10 and 8.1

On Windows Operating Systems, the hosts file is located here ,

C:\Windows\System32\Drivers\etc

host file location in windows 10
C – is the drive Windows OS had been installed.

Make sure you have administrative access/privilege on the computer before attempting to modify it.

Important Note : Some of the Antivirus software including Microsoft Security Essential (Windows Defender) will not allow modifying hosts file as a security precaution. This is to prevent hosts file modification by any virus, spywares or malware. If you face this issue, you need to disable the Antivirus software temporarily or exclude the hosts file from the protection.

Method-1: Easily Edit the Host File in Windows 10/8.1

1) Open the command prompt as administrator.

Search ‘cmd’ on Windows 10 or 8.1 and right click on the Command Prompt and select ‘Run as administrator’.

open command prompt as administrator

2) On the opened command prompt, type ‘cd drivers’ ENTER then ‘cd etc’ ENTER as shown below. This is to go to the location where the host file is located.

host file in windows 10
3) Make sure you are in the correct folder path, it should be C:\Windows\System32\Drivers\etc. Type ‘notepad hosts’ to open the hosts file in notepad.

open hosts file in notepad
4) We assume that you know the content of the file. Type the IP address of the domain/host name you want to give, then name. You can see the examples in same file.

Here is an example, if I need to block facebook on a PC, I can enter the wrong IP address and map it to facebook.com as we showed here.

how to edit host file in Windows 10Once you have modified the file with appropriate settings, click Save from File menu. That’s it, we have successfully modified the hosts file in Windows 10/8.1 now.

Important Note: If you haven’t opened the notepad from ‘Run as Administrator’ command prompt, then you can’t save the Hosts file as shown above. Method-2 should be used in this case.

Method-2

If you are not good in using command prompt, then this method will be handy in editing the hosts file in GU interface.

5) Browse the location of hosts file, it’s under C:\Windows\System32\Drivers\etc. Once you have located the file right click on it and open with notepad.

open with notepad in windows 8.1

6) Modify the hosts file properly. Click Save to apply the changes.

save host file

7) Unfortunately you can’t save this file now, overwriting is not permitted.  Therefore save the modified file to different location, make sure you are saving it as ‘hosts’ and selecting the file type as ‘All Files’ as shown below.

save the host file

I have saved the new hosts file on my desktop.

8.) Now simply copy or cut the file (from Desktop in this case) and paste it at the correct location, C:\Windows\System32\Drivers\etc.

Since the same file is already available at this location, you need to accept replacing the existing hosts file.

replace host file

Once you have replaced the file, the new edited hosts file will be active on your Windows 10 or Windows 8.1 computer. You can find the similar method but with more explanation at this site.

Hope this guide will be helpful in editing the hosts file on the latest Windows 10 or earlier Windows 8.1 and 8 versions.

Comments

  1. Manually accessing the HOSTS file by folder addresses, the HOSTS file edited and save as expected and created a dated HOSTS.backup. But
    Winpatrol (https://www.winpatrol.com/winpatrol/) Options can no longer find the HOSTS file.

    I did not need to disable the anti-virus or Windows Defender.

    Usin 64-bit Windows 8.1 with a 64-bit machine.