CentOS 7.x Bind split DNS configuration

From Notes_Wiki
Revision as of 16:13, 28 August 2022 by Saurabh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Home > CentOS > CentOS 7.x > DNS > CentOS 7.x Bind split DNS configuration

Split view configuration allows different DNS clients to get different response for same DNS query. Hence it is possible to setup both external and internal DNS which resolve to public IP or private IP based on the client who is querying. Other option is to resolve differently for different internal users as well.

To obtain split-view configuration add two or more view section as follows:

   view "<view-name>" {
      //match-clients filter
      //zone definitions
   };

in /etc/named.conf.

In each view you need

   view "internal" {
        match-clients {127.0.0.1/32; 10.0.0.0/8; 172.16.0.0/12; 192.168.0.0/16; };
        //corresponding zones
   };

match-clients {}; directive to match clients.

Last view can have any; in match-clients for catch-all such as:

   view "external" {
        match-clients {any; };
        //corresponding zones
   };   

Note that if views are used all zones must be inside view.. Zone declaration outside view{} is not allowed.


Use named-checkconf and named-checkzone as usual for checking configuration before reload/restart.


Refer:


Home > CentOS > CentOS 7.x > DNS > CentOS 7.x Bind split DNS configuration