How To Edit Hosts File Without Admin Password
You probably already know that DNS changes names of domains into IP addresses. For example, 69.63.184.142 is one of the IPs of facebook.com. You can use a hosts file to change that. It will allow you to link a certain domain name with any IP address you want. These changes will only apply to your PC.
You can use this to redirect some websites and make your own custom links for IP addresses. You have to be careful when editing the hosts file because you can seriously mess things up if you’re not careful. It is the reason why it is not easy to do it, especially for everyday users.
The hosts file can be found in the Windows 10 installation folder and only authorized users can access it. There is a way to bypass this and edit hosts file without the admin password. Read on to find out how.
How to Edit Hosts File
Editing the hosts file in previous versions of Windows used to be much easier. You just needed to disable your antivirus and open the file in notepad, change it as you like, and save the changes. If you try to edit it in Windows 10, you will most likely get an error message, telling you it requires the administrator’s permission.
Here are some solutions that will bypass this error.
Open Notepad as an Administrator
If your primary text editor is Notepad, you have to run it as an administrator to even begin editing this file. You need to follow these steps:
- Press the Windows key to open up the start menu.
- Type “Notepad” into the search box. You should see its icon right away at the top under Best results.
- Right-click it and select Run as administrator.
- When it opens, select File and then Open.
- Go to this location C:\Windows\System32\drivers\etc. Switch from Text Documents to All Files. Choose hosts from the dropdown menu and confirm with Open.
- Enter your changes and confirm by saving.
Check if Your Hosts File Is Read-Only
When a file is read-only, you can freely open in but you can’t change it. Hosts is one of these read-only files but there is a solution. Do this to remove the read-only mark:
- Access C:\Windows\System32\drivers\etc.
- Find the hosts file.
- Right-click it and go to Properties.
- Near the bottom, you should see Attributes and uncheck Read-only next to it.
- Save the changes with Apply and confirm by clicking OK.
Consider enabling read-only again after you’re done editing it.
Move Your Hosts File to Another Location
Some people noticed that you can bypass the access denied prompt by switching the location of the hosts file. First, move it, then make the changes, and finally, return it to its primary location. It sounds complicated but it really is not:
- Find the hosts file in C:\Windows\System32\drivers\etc.
- Copy the hosts file to any other location like your Program Files.
- Use a text editor to open your hosts file from Program Files, e.g. Notepad.
- Edit the file to your liking and then return the hosts file to C:\Windows\System32\drivers\etc folder.
Change Hosts File Security
The reason why you are not allowed to make changes to some files is that they require admin privileges. This is a good defense mechanism unless it is not allowing you, the owner of the computer to make changes. Rest assured, there is a way to fix this and gain complete control over the hosts file:
- Once again go to C:\Windows\System32\drivers\etc.
- Find the hosts files and right click on it.
- Select Properties and then move to the Security window.
- Select the Edit option in the middle of the screen.
- You will see a list of all users that can access the hosts file on your PC.
- Look for your username and see if you have Full control.
- In case you do not, click on Add.
- Type in the username under Enter the object names to select. Tap on Check Names and confirm with OK.
- Your username will now appear on the list.
- Click on it and give it Full control.
- Save your changes with Apply and confirm with OK.
Now you will have the necessary admin privileges to access your hosts file. This will enable you to edit it and save the changes as you please.
Problem Solved
Editing the hosts file might appear as a hard problem to deal with, especially to those who are not that tech-savvy. However, with the methods described in this write-up, you will be editing your hosts file in no time.
7 thoughts on “How To Edit Hosts File Without Admin Password”