Configure DNS Server With Views

This is a tutorial to configure bind dns server with Views . Views help you serve different results based on the query source.

  1. Create an RNDC Key :

key "rndc-key" { algorithm hmac-md5; secret "yourrndckeyhere"; }

  1. Create a Transaction Signature Key :

key "tsigkey" { algorithm "hmac-md5"; secret "yourtsigkeyhere"; };

  1. Create Access Control Lists for the views, Internal and External views in this case :

acl internals { ip blocks for internal view;} acl externals {ip blocks for external views;}

  1. Main Configuration :

options { directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; version "anythinghere"; allow-recursion {127.0.0.1;}; allow-query{any;}; allow-query-cache {none;}; also-notify { slave server ips separated by semicolon;}; allow-transfer {same as above;}; };

  1. Define the Internal View :

view "internal" { match-clients {!key tsigkey; internals;}; zones go over here };

  1. The external view goes here :

view "external" { match-clients {key tsigkey; any;}; server slaveip {keys tsigkey;}; allow-transfer {keys tsigkey;}; zones go over here };