Avatar of cpatte7372
cpatte7372
Flag for United Kingdom of Great Britain and Northern Ireland asked on

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

Avatar of undefined
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
ASKER CERTIFIED SOLUTION
Darr247

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dave Baldwin

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.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Darr247

No... DNS resolves names to IPs.

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:

http://en.wikipedia.org/wiki/Localhost

If you can describe the actual problem, we can widen the scope of the answers.
cpatte7372

ASKER
Cheers
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.