How to change 'localhost' ip address on workstation
Hello Experts
This is a very easy one.
Can someone please show me how to change the ip address of the 'localhost' on my pc.
I believe there is somekind of 'host' or 'winhost' file that I need to change.
At the moment if I ping localhost it comes up with 127.0.0.1, which we all know is the loopback address. I want to change it to specific ip address.
Cheers
Carlton
Windows 7
Last Comment
cpatte7372
8/22/2022 - Mon
David Johnson, CD
edit your hosts file and change localhost to point to where you want. (you need admin permissions)
Dave Baldwin
I recommend against changing localhost to any other IP address. You don't know how many other applications depend on that. Instead, find the IP address of your machine and use that. Here are two methods of finding your IP address: http://www.ehow.com/how_5621076_ip-address-windows-7.html
Doesn't it work the other way around, ping -a will resolve names to IPs but not the other way around? On this machine, 'localhost' resolves to '::1' which is the IPV6 version.
Names are not needed at all to run a ping... when you ping a domain name it gets the IP from DNS and every hop along the path actually uses the IP address, not the name.
If you ping a reachable IP address no domain name is displayed; ping -a essentially does a reverse DNS lookup.
Danny Child
what are you actually trying to achieve here, please?
Localhost is *supposed* to be the loopback address: