Sign up ×
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.

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

1 Answer 1

The BIND keyword you are looking for is allow-recursion. Here is a sample configuration similar to what you want:


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

If you want, say, "" 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.