-1

Trying to add record to C:\Windows\System32\drivers\etc\hosts:

127.0.0.1 10.125.0.100

But seems no effect.

Also tried to add records like:

127.0.0.1 google.com

and result the same.

But if I'll add record like:

127.0.0.1 myself

It works, because my ping works with myself in this case.

What's wrong?

3
  • 2
    what do you mean 127.0.0.1 google.com doesn't work? do you mean google.com still loads in your browser? maybe try a different browser? Feb 23, 2020 at 2:51
  • With 127.0.0.1 google.com added to the hosts file I can believe that maybe using Chrome it appears not to work 'immediately' due to perhaps existing connections, DNS resolver caching in Chrome but I would expect ping google.com to return 127.0.0.1, you don't mention this test specifically. Feb 23, 2020 at 11:28
  • I solved trouble with domains throught "www." adding. But I still don't know what to do with 127.0.0.1 10.125.0.100
    – icYFTL
    Feb 23, 2020 at 12:22

1 Answer 1

0

I tried to add the following record to C:\Windows\System32\drivers\etc\hosts:

127.0.0.1 10.125.0.100

But it seems to have no effect.

The Windows hosts file only maps IP addresses to hostnames e.g.:

127.0.0.1    google.com
127.0.0.1    www.google.com

It cannot redirect one IP to another (ex. 10.125.0.100 to 127.0.0.1).

4
  • 1
    Add-NetNatStaticMapping is solution for windows.
    – icYFTL
    Feb 23, 2020 at 23:10
  • Good solution. =) Feb 24, 2020 at 0:12
  • I came up with the same problem. The answer is imprecise because hosts can redirect from one IP to another one this way. This worked for me in Windows 7 but not in 10. I wonder what changed. Mar 14, 2020 at 10:24
  • @EstusFlask "The answer is imprecise because hosts can redirect from one IP to another one this way. This worked for me in Windows 7 but not in 10." - For clarity, I was referring to the Windows hosts file itself, which only maps IP and domain name combinations (and which hasn't changed in any version of Windows, as far as I am aware). It is of course possible to route one IP to another using different mechanisms in Windows. Mar 17, 2020 at 4:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .