named.conf.local 882 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // Zone configuration for master name server (Salt managed)
  3. //
  4. //
  5. // ACLs
  6. //
  7. {% for acl_name, acl_config in salt['pillar.get']('dns-server:acls', {}).items ()|sort %}
  8. acl {{ acl_name }} {
  9. {%- for entry in acl_config %}
  10. // {{ entry }}
  11. {%- for IP in acl_config[entry] %}
  12. {{ IP }};
  13. {%- endfor %}
  14. {%- endfor %}
  15. };
  16. {% endfor %}
  17. //
  18. // Zones
  19. //
  20. {%- set defaults = salt['pillar.get']('dns-server:zone_defaults', {}) %}
  21. {% for zone, zone_config in salt['pillar.get']('dns-server:zones', {}).items ()|sort %}
  22. {%- set allow_transfer = zone_config.get ('allow-transfer', defaults.get ('allow-transfer')) %}
  23. // {{ zone_config.get ('desc', zone ) }}
  24. zone "{{ zone }}" {
  25. type {{ zone_config.get ('type', defaults.get ('type')) }};
  26. file "{{ zone_config.get ('file') }}";
  27. {%- if allow_transfer %}
  28. allow-transfer { {{ allow_transfer }} };
  29. {%- endif %}
  30. };
  31. {% endfor %}