Returning different DNS records depending on who asks

In BIND 9 (named), is there any way to return different A records depending on the asker's IP address?

When receiving a query for a certain DNS name, I'd like to return external IP address for the queries received from the outside world, and internal IP address for the queries received from the internal subnet.

Update:

Views seem to work OK, but there are about 300 records in the zone file.

Should I copy the whole file (and manage two files from now on) if I only want a single DNS record to be returned differently?


Solution 1:

BIND 9 has a feature to do exactly that, called "views".

There is a good article about how to use them on O'Reilly.

http://www.oreillynet.com/pub/a/oreilly/networking/news/views_0501.html

Solution 2:

For your future reference and for searching purposes this is known as "split horizon dns" It is supported in many DNS packages, including Djbdns.