There is already by default, and it works (Win 7):
::1 localhost
This also works (testing with ping):
::1 hosta
But when I'm trying to add something non-loopback, it doesn't resolve:
fe80::215:afff:fec6:ea64 realhost
So that I can do:
C:>ping fe80::215:afff:fec6:ea64
Reply from fe80::215:afff:fec6:ea64: time=2ms
But can't go with hostname that I put in hosts:
C:>ping realhost
Ping request could not find host realhost. ...
Any way to add an IPv6 address to hosts in Windows?
Finally, I've found the way. I speicied zone ID (11 in my case) in hosts:
Which I've got using
With help of http://technet.microsoft.com/en-us/library/bb726995.aspx
Try like this is host file of window. Hope it can help
C:\Windows\System32\drivers\etc
:According to a Microsoft TechNet article from 2005/2006:
http://technet.microsoft.com/en-us/library/bb727005.aspx
I don't have Win7 nearby so can't test it, but I got caught by the hosts.sam file once. Windows Explorer will hide extensions by default, so I spent a day editing the "hosts" file but it was actually the hosts.sam file. Make sure you are editing the real hosts file.
And antispyware programs will block changes to the hosts file. Malware will add hosts entries to redirect bank websites to fake sites.
Adding ipv6 addresses to the hosts file does work on W2K8, I did it last week.