Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anycast WiND 2 DNS (bind) tool #25

Merged
merged 5 commits into from
Jan 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions tools/dnszones-bind-updater/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
WiND ANYCAST ZONE CREATION TOOL
# 2016-01-27 - Initial Release, as used by WAFN - JammiN

Once enabled via CRON, this tool will pull DNS records from WiND
and then create a valid zone file for BIND anycast servers

The created Zone file is compared to a live zone file. If newer it will
- push the updates to the configured anycast servers.
- restart bind on each server to read new DNS Zone info.


To enable this tool, do as following.

REQUIRES: named-checkzone (debian / ubuntu - apt-get install bind9utils)

Configure the following files as needed:
"zone_global_settings.sh"
"cron/wind"

For each TLD Zone listed in the $ZONES array in "zone_global_settings.sh" do the following
For a forward zone:
In folder "dnszones-poller" copy the forward-example.conf and forward-example.schema
Modify the copied file to suit your Zone and DB.
For a Reverse zone:
In folder "dnszones-poller" copy the reverse-example.conf and reverse-example.schema
Modify the copied file to suit your Zone and DB

Check write permissions on log folder for the cron user.
Check +x permission on zone_update

Run a test (as the cron user) to make sure everything works.
"wind/tools/dnszones-bind-updater/zone_update"

Once satisfied everything is working, enable it.
Copy "cron/wind" to /etc/cron.d/
14 changes: 14 additions & 0 deletions tools/dnszones-bind-updater/cron/wind
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Wind DNS updater
#
MAILTO=root

######
# m h dom mon dow user command
######
#
# only when zone changes happen that it will push them out.

WINDPATH='/dir/to/wind/'

*/2 * * * * WindUser $WINDPATH/tools/dnszones-bind-updater/zone_update > /dev/null 2>&1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

###########################
# CONFIGURATION
$domain = 'forward-tld';
$conf = array(

'zone_type' => 'reverse', //'dns-ip' or 'reverse'

'zone_suffix' => "60.10.in-addr.arpa.", // For Reverse only - Enter suffix (Ensure "." at end)

'ns_domain' => "ns.$domain",

'master_dns' => "ns0.anycast.ns.$domain", //master dns for domain

'schema' => "60.10.in-addr.arpa.schema",

'db' => array(
'server' => "localhost",
'username' => "windDbUser",
'password' => "windReadOnlyPassword",
'database' => "wind"
)
);

###########################



?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$ORIGIN 60.10.in-addr.arpa.
$TTL 5 ; 5 seconds
@ IN SOA ns0.anycast.ns.forward-tld. hostmaster.example.org. (
##SERIAL## ; serial
43200 ; refresh (12 hours)
900 ; retry (15 minutes)
604800 ; expire (1 week)
5 ; minimum (5 seconds)
)

##NAMESERVERS##

##ZONES##
Loading