Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

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.

share|improve this question

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

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.