1

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 8.8.8.8) to solve the other hosts (*.example.com) that are hosted in other places.

Is it possible to archive it ?

Best regards,

Winter
  • 121
  • 1
  • 4

2 Answers2

2

Yes it is possible. I call it Split DNS.

https://en.wikipedia.org/wiki/Split-horizon_DNS

Doing it with Bind

http://www.cyberciti.biz/faq/linux-unix-bind9-named-configure-views/

Ryan Babchishin
  • 6,160
  • 2
  • 16
  • 36
2

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     10.1.2.3 
otherexample.mydomainexample.com  CNAME www.google.com.
nasty-ad-server.badproviderx.net  A     127.0.0.1
Bertl
  • 175
  • 4