Server Fault is a question and answer site for system and network administrators. 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

We have an intranet DNS server (system-config-bind on RHEL) serving office A, and a VPN connecting offices A and B. Office A has a server named "dev".

In office A, to access a server "dev" on the local network, the address is 192.168.1.13

In office B, to access a server "dev" over the VPN, the address is 192.168.2.13

My question is this - can I set the DNS server to return a different IP for "dev" based on the subnet of the incoming request?

Example: In office A, BIND returns 192.168.1.13 as the "dev" IP, because the originating request is from the 192.168.1/24 subnet.

In office B, BIND returns 192.168.2.13 as the "dev" IP, because the originating request is from the 192.168.2/24 subnet.

share|improve this question

migrated from stackoverflow.com Nov 18 '11 at 15:57

This question came from our site for professional and enthusiast programmers.

up vote 7 down vote accepted

You need to use views:

view "officeA" {
   match-clients { 192.168.1.0/24; };

   include "/etc/named.conf.zones-rfc1912";
   include "/etc/named.conf.zones-common";
   include "/etc/named.conf.zones-officeA";
};

view "officeB" {
   match-clients { 192.168.2.0/24; };

   include "/etc/named.conf.zones-rfc1912";
   include "/etc/named.conf.zones-common";
   include "/etc/named.conf.zones-officeB";
};
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.