When I develop web-apps I sometimes have to hard-code full URLs into my generated markup. Even though one can generally get by using relative URLs a la

<a href="/path/to/something">Something</a>

things can get more complicated when I have to point to another server or protocol like

<a href="https://www.example.com/path/to/something">Something Secure</a>

This makes it harder to run development versions of my webapp on Windows because I am constantly modifying my hosts file to override DNS.

My question is simply, are there any better tools to modifying the hosts file to override what I might get through DNS. I was thinking a simple DNS server designed for local web app development. I've searched around and have not been able to find anything good.

Even though it doesn't matter, just FYI I develop with Ruby (though not necessarily Rails) and deploy the production versions on CentOS. My development machine must remain Windows.


  • 5
    Can't think of anything that could be simpler than editing hosts file.
    – Sandman4
    Dec 26, 2011 at 21:26

2 Answers 2


Although editing the hosts file is as simple as it gets, your next option is to setup BIND to act as a master server for the domains you want to "nullify" and as a forwarder for the rest of the queries. You will have to read the ARM [ pdf ] though to see in detail how to configure this.

Then have your client test machines use this server as their DNS server for as long as the test runs.

There exist ports of BIND for windows

  • Aren't there any simple local DNS servers than BIND?
    – mailq
    Dec 27, 2011 at 1:47
  • Like this: posadis.sourceforge.net/sans
    – mailq
    Dec 27, 2011 at 1:49
  • posadis looks cool, but I think in this case the OP is seeking for something that works as a resolver with the exception of the domains he wants to exclude.
    – adamo
    Dec 27, 2011 at 7:39

Do you want to block these domains or redirect them to another IP?

If you are just looking to block the domains, then using a tool designed for parental control may be easier than running a local DNS server.


Still don't know if this would be easier than editing host files.

Not a windows SA, so do not know what options there are for running local DNS server on windows outside of their Window server products.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy