Change Or Add A Host File

Joined
Feb 22, 2017
Messages
4
Reaction score
0
i have to change or add a host file. I was given explicit instruction and i have changed it according to instructions several times
I go to try it and find that file reverts back to original. Told to to stop defender, tried that - still erases new file.
Using Windows 10 pro with all upgrades. Could someone that has actually done this successfully please help me. Thanks
 

Trouble

Noob Whisperer
Moderator
Joined
Nov 19, 2013
Messages
13,411
Reaction score
2,319
Typically the C:\Windows\System32\drivers\etc\hosts file is protected against edits.
IF you have explicitly granted your user account full control to the file and are able to make edits and save the file as "hosts" no extension in the same location and your edits are not preserved, then.....
I would suspect that there is some third party utility that is reverting your changes.
Seems to me I remember Spybot Search and Destroy back in the day doing something like this and there are likely others as well.

After the edits are saved.... when are they reverted?
Immediately? IF you go back to the saved file are the changes gone?
After a restart?
After a log off and on?

How many edits are you making?
What size is the file..... before and then after the edits?
While there is not a limit to the file size there are other limits that you may need to address
https://library.netapp.com/ecmdocs/ECMP1368834/html/GUID-C6F3B6D1-232D-44BB-A76C-3304C19607A3.html
 
Joined
Feb 22, 2017
Messages
4
Reaction score
0
Typically the C:\Windows\System32\drivers\etc\hosts file is protected against edits.
IF you have explicitly granted your user account full control to the file and are able to make edits and save the file as "hosts" no extension in the same location and your edits are not preserved, then.....
I would suspect that there is some third party utility that is reverting your changes.
Seems to me I remember Spybot Search and Destroy back in the day doing something like this and there are likely others as well.

After the edits are saved.... when are they reverted?
Immediately? IF you go back to the saved file are the changes gone?
After a restart?
After a log off and on?

How many edits are you making?
What size is the file..... before and then after the edits?
While there is not a limit to the file size there are other limits that you may need to address
https://library.netapp.com/ecmdocs/ECMP1368834/html/GUID-C6F3B6D1-232D-44BB-A76C-3304C19607A3.html
I have to make one edit for a single website. I make the change, actually I add a new IP address, thru command (as administrator) and notebook. I open website and get message that address has not changed. I know it was added, as I checked it, but when I go back thru command and notebook the address has been erased. As I said in original post I disabled Defender while I did this. Perhaps I am not putting new address in correct area, but I have tried to do exactly as people that claim to be in the know tell me works. I have not had one person say that they have actually done this with Win 10 Pro, though and that is puzzling to me. Please I do need help
 

Trouble

Noob Whisperer
Moderator
Joined
Nov 19, 2013
Messages
13,411
Reaction score
2,319
thru command (as administrator) and notebook
Not sure why you are using a command prompt.
Why don't you just use file explorer to browse to C:\Windows\System32\Drivers\ETC
AND
Open the hosts file by double clicking it and choosing (when prompted) "Notepad"
Add your edit, save and close.
IF you don't get an error when saving you should be good to go.
Double check by opening it again to see if your edit is present.
 
Joined
Feb 22, 2017
Messages
4
Reaction score
0
Not sure why you are using a command prompt.
Why don't you just use file explorer to browse to C:\Windows\System32\Drivers\ETC
AND
Open the hosts file by double clicking it and choosing (when prompted) "Notepad"
Add your edit, save and close.
IF you don't get an error when saving you should be good to go.
Double check by opening it again to see if your edit is present.
Tried that way, message comes up can not save
 

Trouble

Noob Whisperer
Moderator
Joined
Nov 19, 2013
Messages
13,411
Reaction score
2,319
Exactly. In my original post to you in this thread
explicitly granted your user account full control to the file and are able to make edits and save the file as "hosts" no extension in the same location
So browse to the "hosts" file and right click it and choose "Properties"
Select the "Security" tab and click the "Advanced" button
Click the "Change permissions" button
Click the "Disable inheritance" button and choose "Convert" when prompted
Now click the "Add" button
Then the "Select a principal" link near the top
Click "Advanced" button
Click "Find now" button
Choose your user name from the list at the bottom and double click it and click OK
Now tick the "Full control" check box at the top and click "OK" again and "OK" again and answer "Yes" when prompted, then OK again
That should do it.
 
Joined
Feb 22, 2017
Messages
4
Reaction score
0
Exactly. In my original post to you in this thread

So browse to the "hosts" file and right click it and choose "Properties"
Select the "Security" tab and click the "Advanced" button
Click the "Change permissions" button
Click the "Disable inheritance" button and choose "Convert" when prompted
Now click the "Add" button
Then the "Select a principal" link near the top
Click "Advanced" button
Click "Find now" button
Choose your user name from the list at the bottom and double click it and click OK
Now tick the "Full control" check box at the top and click "OK" again and "OK" again and answer "Yes" when prompted, then OK again
That should do it.
WOW!! Thank you, that looks like it is exactly what I need, It will be a while before I can try it, but I will do so, and I appreciate your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top