Skip to content

Commit

Permalink
add forward zone file
Browse files Browse the repository at this point in the history
  • Loading branch information
shaon committed Apr 1, 2016
1 parent 28ec7ae commit 444bb51
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions recipes/dns_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,19 @@
source "named.conf.erb"
action :create
end

node['bind']['zones']['forward'].each do |zone|
template "/var/named/#{zone['file']}" do
source "namedzone.erb"
action :create
variables zone
end
end

node['bind']['zones']['reverse'].each do |zone|
template "/var/named/#{zone['file']}" do
source "namedzone.erb"
action :create
variables zone
end
end
10 changes: 10 additions & 0 deletions templates/default/namedzone.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$ORIGIN .
$TTL 86400 ; 1 day
<%= @name %> IN SOA <%= node['fqdn'] %>. root.<%= node['bind']['zones']['name'] %>. (
2011071306 ; serial
3600 ; refresh (1 hour)
1800 ; retry (30 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS <%= node['fqdn'] %>.

0 comments on commit 444bb51

Please sign in to comment.