Windows redirect traffic to different DNS name not fixed IP address (hosts file equivalent)

Posted by Arik Raffael Funke on Super User See other posts from Super User or by Arik Raffael Funke
Published on 2011-02-25T17:17:32Z Indexed on 2011/02/26 23:27 UTC
Read the original article Hit count: 293

Using the Windows hosts file, one can redirect traffic for a domain to a specific IP address, e.g.

domainA.com --> 127.0.0.1

I am looking for a SIMPLE way to do the same, but for a target domain name not for a target IP address (as this is dynamic), I.e.

domainA.com --> domainB.com


Addition: After the getting some initial answers I think I need to concretise my question.

Situation: I have an application which looks up the IP of the target domain via DNS and then connects via HTTP to the IP address. I do not have control over any proxy settings.

Option 1 Basically I am looking for a way to:

  • intercept DNS requests for a domainA.com
  • launch a DNS request for a domainB.com
  • serve the IP of domainB.com in response to the request for domainA.com

Without running an entire DNS server.

Option 2 If a DNS server is the only way, in the alternative I would also be happy with an solution to how to define a non-standard DNS-server for a single application. Any ideas for wrapper applications, etc?

© Super User or respective owner

Related posts about Windows

Related posts about networking