Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Is there any Firefox plugin that allows to change how Firefox perform name resolution? I want to override the system-wide hostname resolver to attach some IP to certain hostnames.

Let me explain. Let's say I'm developing a new website and I want to test using the actual hostname but my site is run by a local webserver, I'd like to do this:

System-wide resolver: www.domain.com ---> 10.20.30.40
Ovveride by addon:    www.domain.com ---> 127.0.0.1

Is there anything like this? Thank you.

share|improve this question
add comment

2 Answers

There are many Firefox add-ons that do just this:

  • HostAdmin
  • ChangeHosts
  • SwitchHosts

A search for "Firefox hosts add-on" will yield a whole lot more.

share|improve this answer
add comment

You don't even need a plugin to do that. You can do it with the proxy settings. Specifically, you can use the proxy auto-configuration option with a PAC file that you create. The PAC file is written in javascript. For you it might look something like this:

function FindProxyForURL(url, host) {
    if (host=='www.domain.com'){
        return 'PROXY 127.0.0.1:80';
    }
    // All other domains should connect directly without a proxy
    return "DIRECT";
}

Save this as my-proxy.pac file and point the proxy auto-configuration at it.

For more information on proxy autoconfiguration, see wikipedia: http://en.wikipedia.org/wiki/Proxy_auto-config

share|improve this answer
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.