I have a domain (example.com) that the hosts are split in several different networks/places. Most of these hosts are hosted in our office. What i am trying to do is configure a zone that resolves internally these hosts (eg1.example.com, eg2.example.com) that are hosted here and then redirect to other dns (like google to solve the other hosts (*.example.com) that are hosted in other places.

Is it possible to archive it ?

Best regards,


Yes it is possible. I call it Split DNS.


Doing it with Bind



If you want to partially override public DNS server entries, use the Bind9 "RPZ" feature. With this, you can partially overwrite the DNS answers and e.g. redirect them to you own entries. Example config:

a) enable RPZ in named.conf:

options {

  response-policy { zone "rpz-overrides"; };

zone "rpz-overrides" IN {
   type master;
   file "db.rpz-overrides";

b) Add the special zone file db.rpz-overrides in RPZ format:

@ IN SOA localhost. root.localhost.  (2 3H 1H 1W 1H)

IN NS localhost.

; overrides
examplehost.mydomainexample.com   A 
otherexample.mydomainexample.com  CNAME www.google.com.
nasty-ad-server.badproviderx.net  A

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.