Reputation: 1951
I'm trying to define some fake domains to point to 127.0.0.1
, but it does not take effect at all.
I edit C:\Windows\System32\Drivers\etc\hosts.txt
(I know I should have administrator permissions, so the file gets modified correctly) and add for example 127.0.0.1 abcde.com
and save the changes, but when I ping this domain, it is pinging the corresponding server not my own machine. I also tried modifying the IP of existing domains in that file, but there is no changes.
I also tried to use some command like ipconfig /flushdns
and also rebooted my Windows, but still working as before.
It seems like that there is another file or something like a presistent cache that prevents the changes take effect.
In this case, what should I do?
Upvotes: 1
Views: 1888
Reputation: 7960
The hosts file name in the question is wrong:
C:\Windows\System32\Drivers\etc\hosts.txt
-->
C:\Windows\System32\Drivers\etc\hosts
Remove the txt extension. Note that this file should exists in your machine so just edit it.
Upvotes: 2