[Easily] How to Edit Host File in Windows 8.1 and 8

Host file is an important system file which maps host/site names with its IP addresses manually. So internet browsing or accessing any network places will be quicker by avoiding DNS server request, also we can manually set DNS name and IP for specific sites in this file. Host file is a plain text file but with no any file format extension. Following guide shows how to edit host file in Windows 8.1 and 8 easily.

We usually modify the host file by ‘edit’ DOS command in earlier Windows operating systems, but edit DOS command is not included in Windows 8.1 and 8. You would be getting the following error message when you try edit command in Windows 8/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 require 16-bit QBASIC.EXE and it will not work on 64Bit Windows 8 or 8.1. So how to edit host file here? We can use Notepad or any simple text editing software for this purpose.

Let us Easily Edit Host File in Windows 8.1 or 8

On Windows Operating Systems host file is located here ,


Host file location in Windows 8.1

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

Important Note : Some of the anti virus software including Microsoft Security Essential (Windows Defender) do not allow modifying host file for security purpose. This is to prevent host file modification by any virus, spywares or malware. If you face this issue, you need to disable the anti virus software temporarily or set exception for the file.

Once you have located the file right click on it and open with notepad.

open with notepad in windows 8.1

Modify the host file properly, I assume that you already knew it. Click Save Windows 8.1 or 8 host file.

save host file

Unfortunately you can’t save this file now, overwriting is not permitted.  Save the 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 host file on my desktop.

Now simply copy or cut the file and paste it at correct location, C:\Windows\System32\Drivers\etc.

Since the same file with extension already available at this location, you need to accept replacing existing host file with new one.

replace host file

Once you have replaced the file, the new edited host file will be active on your Windows 8.1/8 computer.

Another Method

You can open the notepad as administrator then browse the host file to edit. If you do this method, you can save the host file from notepad ( which was opened as administrator) straightaway without saving to diffrent location and replace it as mentioned on the first method.

You can follow this guide to get more information about this method on how to edit host file in Windows 8.1 or 8.


  1. says

    Thanks a lot Dinesh. I was facing issue with editing host file in Windows 8 but now I learnt how to edit it. Thanks!

  2. Ed W says

    Would people please stop saying that this does not work, of course it works. Read the article:

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

    If you do not understand that then you’re out of your depth. That is no-one’s problem but your own.

  3. EMERZON says

    simply run first NOTEPAD as administrator then click file>open then locate HOST at local disk>windows>system32>drivers>etc from there do any changes you want and just hit close and save

  4. says

    It appears that Windows 8.1 now sets the file attribute to ‘Read Only’. If you go into properties and uncheck the box, you can edit the file normally without having to go through the copy and paste procedure.

  5. matt says

    I was searching for a while on Windows 8. It worked perfectly. you brighted my day :)