1

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.

1

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

Basically:

options {
 directory "/var/named";
 allow-recursion {192.168.1.0/24;};
};
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, 10.1.2.3 when queried from the Internet but the IP 192.168.1.2 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.