Forum Moderators: phranque

Message Too Old, No Replies

How to Redirect IP Address Using Hosts File

How to Redirect IP Address Using Hosts File

         

tonywebster

5:29 am on Feb 21, 2006 (gmt 0)



I have a legacy application which makes a call to an IP address at startup which is no longer valid. I would like to redirect this to another IP address which is now valid - can I do this with the Windows HOSTS file?

I don't have the source code for the application so am stuck with application making a call to the old IP address.

If this is the wrong forum to ask this question, please do let me know and point me in the right direction.

Kind regards,
Tony W

bill

6:50 am on Feb 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld tonywebster.

The hosts file should work to redirect in the way you described because Windows will check this file before it checks DNS servers. A lot of people use the Hosts file to block ads like this:

127.0.0.1 ad.example.net

This would redirect redirect requests for the ad server to your localhost IP. You could just as easily substitute the new IP for your legacy application.