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.
- Create an RNDC Key :
key "rndc-key" { algorithm hmac-md5; secret "yourrndckeyhere"; }
- Create a Transaction Signature Key :
key "tsigkey" { algorithm "hmac-md5"; secret "yourtsigkeyhere"; };
- 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;}
- 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;}; };
- Define the Internal View :
view "internal" { match-clients {!key tsigkey; internals;}; zones go over here };
- The external view goes here :
view "external" { match-clients {key tsigkey; any;}; server slaveip {keys tsigkey;}; allow-transfer {keys tsigkey;}; zones go over here };