TechJunkie is a BOX20 Media Company

Home PC Windows How To Edit Hosts File Without Admin Password

How To Edit Hosts File Without Admin Password

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:

  1. Press the Windows key to open up the start menu.
  2. Type “Notepad” into the search box. You should see its icon right away at the top under Best results.
  3. Right-click it and select Run as administrator.
    notepad-admin
  4. When it opens, select File and then Open.
  5. 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.
  6. Enter your changes and confirm by saving.
    hosts

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:

  1. Access C:\Windows\System32\drivers\etc.
  2. Find the hosts file.
  3. Right-click it and go to Properties.
  4. Near the bottom, you should see Attributes and uncheck Read-only next to it.
  5. Save the changes with Apply and confirm by clicking OK.
    hosts-read-only

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:

  1. Find the hosts file in C:\Windows\System32\drivers\etc.
  2. Copy the hosts file to any other location like your Program Files.
  3. Use a text editor to open your hosts file from Program Files, e.g. Notepad.
  4. 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:

  1. Once again go to C:\Windows\System32\drivers\etc.
  2. Find the hosts files and right click on it.
  3. Select Properties and then move to the Security window.
  4. Select the Edit option in the middle of the screen.
  5. You will see a list of all users that can access the hosts file on your PC.
  6. Look for your username and see if you have Full control.
  7. In case you do not, click on Add.
  8. Type in the username under Enter the object names to select. Tap on Check Names and confirm with OK.
  9. Your username will now appear on the list.
  10. Click on it and give it Full control.
  11. Save your changes with Apply and confirm with OK.
    change-hosts-file-security

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.

 

Minitab vs. Matlab - Which is Better

Read Next 

2 thoughts on “How To Edit Hosts File Without Admin Password”

zsos says:
Terrible….How can you post something like this? “How To Edit Hosts File Without Admin Password” and then step one is to open notepad as an admin .
anastasis says:
hey dude my dad is a computer expert i tried both ways and he had locked everything in my laptop what can i do?

Leave a Reply

Your email address will not be published. Required fields are marked *


Arch

Jun 4, 2019

1862 Articles Published

More