Take the 2-minute tour ×
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: 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

share|improve this answer

Your Answer

 
discard

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.