ddns-scripts: add support for glue records
authorMathias Kresin <redacted>
Tue, 24 May 2016 19:30:40 +0000 (21:30 +0200)
committerMathias Kresin <redacted>
Wed, 1 Jun 2016 18:59:47 +0000 (20:59 +0200)
commit1416770e3b363c68cbff99ab0b67f45651f7bdf6
treece5f4e4119c87c981821325e7d7b19d798393a39
parent3a5fb69389ed0bba638a7fdf7a7d76a4e9c5fd13
ddns-scripts: add support for glue records

Assuming the following dns zone configuration for kresin.me:

.                   1800  IN  NS  ns.inwx.de.
home.kresin.me.     1800  IN  NS  gw.home.kresin.me.
gw.home.kresin.me.  60    IN  A   198.51.100.1

Using the example, gw.home.kresin.me is a glue record and used as DDNS
record as well. gw.home.kresin.me points to the OpenWrt installation
where the ddns-scripts are running.

Since ns.inwx.de isn't the authoritative server for home.kresin.me,
a query for the the A record of gw.home.kresin.me will be "forwarded"
to and replied by the authoritative server 198.51.100.1. If the
authoritative server can't be reached, the query times out without any
address returned.

The only way to get the A record of the glue record is to use bind
host in verbose output mode, query ns.inwx.de for gw.home.kresin.me and
evaluate the additional section of the response.

To my knowledge, only bind host in verbose output mode shows the
additional section of the response. Therefore, this features depends on
bind host.

It is not possible to use the bind host verbose mode for all queries.
In verbose mode the "has address" line isn't returned. Grepping for the
hostname might fail if the hostname is CNAME. Grepping for the first
occurrence of an ip-address is way to error prone, since it could
return the ip address of a different record type.

Signed-off-by: Mathias Kresin <redacted>
net/ddns-scripts/Makefile
net/ddns-scripts/files/dynamic_dns_functions.sh
net/ddns-scripts/files/dynamic_dns_updater.sh
git clone https://git.99rst.org/PROJECT