Our ISP accidentally switched us from a static IP to DHCP (long story) and it might be another day or two before we get our static IP back. In the meantime I'm trying to just use a host file on my machine but I can't get it to take. I've done this a million times before but I can't seem to get it to work on my Windows 7 machine. Here's my simple one line that I'm trying to do:
127.0.0.1 test.example.com
I've added that to c:\windows\system32\drivers\etc\hosts
using an elevated notepad. Then I run ipconfig /flushdns
and arp -d
and try pinging it with ping test.example.com
but I just get:
Ping request could not find host test.example.com. Please check the name and try again.
If I repeat the exact same process on a virtual XP machine on the same physical machine it resolves to 127.0.0.1
which is exactly what I want.
There's a similar post here that talks about checking the proxy settings but I don't have one configured.
I've also checked the value of the registry key below and its set at 500 which is second lowest (class is 8):
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider
I also read a post that Windows 7 wants 8 spaces between the IP and the host and I tried that (as well as 7 spaces, 1 space, 1 tab) to no avail.
I don't have time to setup a DNS server locally so that's not an option. This is all command-line, I'm not even at the browser level yet. Yes, I'm sure that c:\Windows
is the correct path, I've checked %SystemRoot%
. And yes, I'm sure that I'm saving the file as hosts
without an extension.
mail
,www
, etc as well asTXT
records likeSPF
. I'd really like to avoid duplicating all of these records so that I can fix just 1 for a day or two.::1:
although we're only using IP4. The domain I'm trying to redirect is a standard .com domain. Our network is a standard Windows AD setup. We have a local Windows DNS that we use for AD only (see my previous comment about not wanting to recreate dozens of records). Most subdomains of the domain that I'm routing are external, a few point to our old static IP which is the IP of our DSL line which I'm trying to change via host files. I'm updating the main DNS, too, but I can't adjust TTL so it takes a while to update.ipconfig /flushdns
,arp -d
and for the heck of itnbtstat -R
and still can't get it to resolve. Yes, pinginglocalhost
and127.0.0.1
still worked just fine without my network connection. No, I don't have a wi-fi connection, too.