Based on LiveDNS Gandi API, maybe dnscontrol in next iteration.
- Python3 (see why below)
- git-crypt
How to install with brew:
$ brew install git-crypt
Read readme file in:
I want to update example.io
DNS configuration.
- I go
example.io
directory - I update
records.txt
file - I launch
./diff.py
to see the diff betweenrecords.txt
and current live config - if diff is ok, I launch
./push_records.py
to push my config - I commit my update to git
$ git-crypt
$ git-crypt add-gpg-user contact@stephane-klein.info
Note: this workflow support only LiveDNS Gandi provider.
$ mkdir example.com
$ cd example.com
$ ln -s ../scripts/diff.py diff.py
$ ln -s ../scripts/display-live-records.py display-live-records.py
$ ln -s ../scripts/push_records.py push_records.py
$ ln -s ../scripts/README.md README.md
Next: follow example.com/README.md
instructions.
I use python here because this curl command return error: Error while parsing rdata: Text input is malformed.
but same config work with Python script:
$ curl -v -X PUT \
-H "Content-Type: text/plain" \
-H "X-Api-Key: $(cat api-key.secret)" \
--data-binary @records.txt \
https://dns.api.gandi.net/api/v5/zones/xxxxx/records
I'll maybe use dnscontroll in next iteration when dnscontrol howe brew will be available.