Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to map 'localhost' to an IP address elsewhere on the network, say '10.0.1.1' for example. I've tried editing my hosts file, changing the entry from:

127.0.0.1   localhost

to

10.0.1.1    localhost

with no luck. The closest I've gotten is using DNS spoofing via Charles. Adding a DNS spoof entry mapping the host name 'localhost' to '10.0.1.1' works fine in Firefox, but fails in Internet Explorer, basically showing IE's 404 page. I'm wondering if there's some specific setting or way I can get DNS spoofing to work in IE?

The main issue I'm trying to resolve is that our development environment points to 'localhost' and rather than setting the dev env up in a legacy Windows laptop to try and debug, point to a server that has it all setup and I can make the changes remotely.

share|improve this question
2  
I wouldn't point localhost away from 127.0.0.1 because I have no idea what you'll break, but I bet it will be a nontrival amount of stuff. YMMV of course. –  Fred Apr 24 '10 at 22:16
add comment

3 Answers

You can use this nifty utility http://www.quantumg.net/portforward.php

Use 80 for port, and add IP and port of the machine you want it to forward to. Open your browser (tested in FF and IE8) and it should just work.

share|improve this answer
add comment

There is a way to forward specific port of any IP address to another with PassPort: http://sourceforge.net/projects/pjs-passport/ I think it would be enough for you to add 80 port.

share|improve this answer
    
Only solution to work on Win XP. –  Castrohenge Sep 16 '13 at 11:58
add comment

As far as I know it's not possible to remap localhost, since it's part of the TCP/IP stack, also a lot of things depends on this setting and I would break almost everything network related. If you can provide a little more of insight about what you are trying to achieve I may be able to help you. For example you could set up a small apache server (XAMPP for example) and set an htaccess redirect to the other ip.

share|improve this answer
    
This seems to defeat the purpose of a config file :( It works fine on Win7, but not XP for me. –  Aram Kocharyan Aug 3 '13 at 4:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.