Over the last week @kate and I have setup a system for managing bind zonefiles at git.coop and I’m rather pleased with this, it means that not very technical people have a web based interface to edit their domain name zone files and more technical people have the option to integrate domain name management into other processes.
When a edit is submitted we use GitLab CI to spin up a Debian Docker container to test the zone files in:
before_script:
- apt update
- apt install -y bind9utils dnsutils wget
- wget https://git.coop/webarch/scripts/raw/master/bin/named-checkserial
test:
script:
- for zone in *.hosts; do named-checkzone localhost $zone; done
- for zone in *.hosts; do named-checkzone $(echo $zone | sed 's/\.hosts$//') $zone; done
- for zone in *.hosts; do bash ./named-checkserial $zone; done
This takes less than a minute to run and ends with an output like this:
$ for zone in *.hosts; do named-checkzone localhost $zone; done
zone localhost/IN: loaded serial 2018041601
OK
$ for zone in *.hosts; do named-checkzone $(echo $zone | sed 's/\.hosts$//') $zone; done
zone example.org.uk/IN: loaded serial 2018041601
OK
$ for zone in *.hosts; do bash ./named-checkserial $zone; done
Serial number for example.org.uk in example.org.uk.hosts has been increased compared to the live version.
Job succeeded
Then our four (two in Sheffield, one in Iceland and one in Luxembourg) DNS servers update with the changes.
We are currently offering this service for a one-off setup of £60.