Conditional DNS forwarding with named on Linux



I have a Centos 5.2 server which runs named for DNS resolution - it doesn't hold any information of its own, and just forwards all requests. From the named.conf:

options {
[...]
        forwarders { 1.1.1.1; 1.1.1.2; };
};

All other lines in named.conf are left as default.

I want to change the configuration so requests for anything under newdomain.com get passed to 22.22.22.22, while requests for any other address go to 1.1.1.1 or 1.1.1.2

How can I configure the DNS on this server to do this?
DrStalkerAsked:
Who is Participating?
 
georgekrajCommented:
Hi,
      In /etc/named.conf file, you can have global attributes and domain specific attributes.

For domain specific attributes, use the following syntax.

zone "newdomain.com" {
type forward;
forwarders { 22.22.22.22; };
};

Then, use this as a global attribute.

options {
[...]
        forwarders { 1.1.1.1; 1.1.1.2; };
};

Please try this and give your feedback.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.