Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A program I'm using makes a request for the external IP 74.125.234.83 and I would like to make this request redirect to 127.0.0.1 so I can test my local server, I don't have access to the source of the program so I have to make that request redirect to the loopback on the operating system.

I'm using Windows 7 Ultimate, how can I do that ?

share|improve this question

migrated from stackoverflow.com Aug 1 '11 at 20:29

This question came from our site for professional and enthusiast programmers.

2  
Is the program resolving that address or is 74... hardcoded? If it's resolving it, just create an entry in the hosts file to 127.0.0.1. – Josh Aug 1 '11 at 19:34
    
The program does not resolve, it connects directly to that address :( – Anderson Aug 1 '11 at 19:47
    
Fire up a hex editor and replace the string/address in the binary :P – Josh Aug 1 '11 at 19:53
    
That's a possibility but I was wondering if there was a way to do that using the OS :) – Anderson Aug 1 '11 at 19:59
    
You should probably move this question to superuser or serverfault - the solution you are looking for is really not a development question. – Josh Aug 1 '11 at 20:04
up vote 2 down vote accepted

You can add that hardcoded IP to the loop back interface and set the netmask to 255.255.255.255 (/32).

You can't do that through a GUI, so you'll have to use the netsh command. Use netsh int ip sh int to get the interface id of the loop back interface and netsh int ip add addr <ID> <IP>/32 st=ac sk=tr to add the address. (Help can be found by typing netsh int ip add addr with no arguments.)

This will affect all programs on your computer though.

share|improve this answer

Your keywords is "Destination NAT" (DNAT).

I never tried to configure NAT in windows, but I think is possible to configure NAT:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .