named.conf.j2 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // BIND9 Main Configuration File
  2. // Documentation: https://bind9.readthedocs.io/
  3. {% if tsig_enabled %}
  4. include "/etc/bind/tsig.key";
  5. {% endif %}
  6. acl "trusted" {
  7. 127.0.0.1;
  8. ::1;
  9. 10.0.0.0/8;
  10. 172.16.0.0/12;
  11. 192.168.0.0/16;
  12. };
  13. options {
  14. directory "/var/cache/bind";
  15. // DNS forwarders for recursive queries
  16. forwarders {
  17. 1.1.1.1;
  18. 8.8.8.8;
  19. };
  20. // Allow recursion from trusted networks only
  21. allow-recursion { trusted; };
  22. // Allow queries from any (adjust as needed)
  23. allow-query { any; };
  24. // Disable zone transfers by default (enable per-zone with TSIG)
  25. allow-transfer { none; };
  26. // DNSSEC validation
  27. dnssec-validation auto;
  28. // Listen on all interfaces
  29. listen-on { any; };
  30. listen-on-v6 { any; };
  31. // Disable query logging (enable for debugging)
  32. // querylog yes;
  33. };
  34. // Local zones
  35. zone "localhost" {
  36. type master;
  37. file "/etc/bind/db.local";
  38. };
  39. zone "127.in-addr.arpa" {
  40. type master;
  41. file "/etc/bind/db.127";
  42. };
  43. zone "0.in-addr.arpa" {
  44. type master;
  45. file "/etc/bind/db.0";
  46. };
  47. zone "255.in-addr.arpa" {
  48. type master;
  49. file "/etc/bind/db.255";
  50. };
  51. // Include your custom zones
  52. include "/etc/bind/named.conf.zones";