where is the hosts file on windows and how do i edit it

need to add a line to the hosts file for a local test site. found it but notepad says i don't have permission to save. what's the correct way?
1

Leave A Reply

Log in to post an answer.

1 Answer

neha_chhibber Nov 05, 2026
luke_gadget
C:\Windows\System32\drivers\etc\hosts The catch is you can't save it unless the editor runs as admin. Search Notepad in Start, right-click > Run as administrator, then File > Open, paste that folder path and change the file type dropdown to All files, otherwise the hosts file doesn't show (it has no extension). After saving run ipconfig /flushdns.