I want to configure bind such that the host served differ depending on the domain asked.

the use case is the following: it must respond to anyone if the requested domain is in the domain my server is authoritative for, and must accept to respond to a limited range of IP addresses otherwise. (I don't want a open recursive resolver)

I think this should be possible through the ''listen-for'' directive, but i'm unsure.


The BIND keyword you are looking for is allow-recursion. Here is a sample configuration similar to what you want: http://www.zytrax.com/books/dns/ch6/#master


options {
 directory "/var/named";
 allow-recursion {;};
zone "." {
 type hint;
 file "root.servers";
zone "example.com" in{
 type master;
 file "master/master.example.com";

If you want, say, "www.example.com" to have the IP, say, when queried from the Internet but the IP when queried from your office, this is called split horizon DNS

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.