Windows – Simple DNS Server or Tool for Local Web App Development

domain-name-systemhostsrubywebwindows

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.

Thanks!

Best Answer

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

Related Topic