summaryrefslogtreecommitdiff
path: root/bin/update-dns.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/update-dns.sh')
-rwxr-xr-xbin/update-dns.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/bin/update-dns.sh b/bin/update-dns.sh
new file mode 100755
index 0000000..1262195
--- /dev/null
+++ b/bin/update-dns.sh
@@ -0,0 +1,38 @@
1#!/bin/bash
2
3view="internal"
4#view="external"
5
6zone_key=$(grep "key \"master-view-$view\"" <<EOF
7key "master-view-external" { algorithm hmac-sha256; secret "$(pass Pomona/DNS_External_Key)"; };
8key "master-view-internal" { algorithm hmac-sha256; secret "$(pass Pomona/DNS_Internal_Key)"; };
9EOF
10)
11
12# Zone Transfer
13#zone=""
14#dig @ns1.as398223.net +nostats +nocmd -k <(echo $zone_key) AXFR $zone
15#exit 0
16
17if [[ $1 != "-r" ]]; then
18 echo "Dry run mode, no changes made" && exit 1
19fi
20
21# Update Records
22# NOTE: White space between PTR lines matters for buggy reasons
23(
24cat <<EOF
25
26
27
28update add dev.ssh-proxy.crute.me. 60 IN A 127.0.0.1
29
30
31
32
33
34
35send
36EOF
37) | nsupdate -k <(echo $zone_key)
38echo "Updated: $?"