Server Fault is a question and answer site for system and network administrators. 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

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="">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.


share|improve this question
Can't think of anything that could be simpler than editing hosts file. – Sandman4 Dec 26 '11 at 21:26

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

share|improve this answer
Aren't there any simple local DNS servers than BIND? – mailq Dec 27 '11 at 1:47
Like this: – mailq Dec 27 '11 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 '11 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.

share|improve this answer

Your Answer


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.