views:

230

answers:

2

I want to configure bind/write driver that resolves DNS requests based on the ip address of the client.

We want to unify the domain names of all test environments for our web application. Instead of having many domains like test.mysite.com, qa.mysite.com, etc for different staging environments we want only to have www.mysite.com and make it configurable which test environment it "points" to.

To accomplish this I am thinking of providing web interface for configuring which test environment has to be used. DNS requests than should be answered based on this configuration.

Do you think something like this is doable with bind or other dns server? And how does it compare to writing client application that modifies the local hosts file?

+1  A: 

You can do this with the location facility in djbdns. Your task in making the web interface is writing out (and parsing, if you don't want to have a separate database backend) the DNS data files in the right format.

Here's another resource on a related topic, "split horizon DNS". It's not the same as your question, but the ideas in the article can be adapted to your needs: http://homepages.tesco.net./~J.deBoynePollard/FGA/dns-split-horizon.html

Chris Jester-Young
+2  A: 

You can use PowerDNS with the pipe backend to return different IP addresses dependent on the client's IP address.

cmeerw
Yes, nice software and there are several ways to write a backend (the pipe being the simplest).
bortzmeyer