diff options
author | Erich Eckner <git@eckner.net> | 2020-03-04 08:53:28 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-03-04 08:53:28 +0100 |
commit | aa208e9dd52d91e7144867982dce31d6f364d856 (patch) | |
tree | e16e3712518929cf535b7698b50665d08ea86198 | |
parent | 453088811146e223ea3a5589a2e9f53a89d4b3bc (diff) | |
download | ddns-aa208e9dd52d91e7144867982dce31d6f364d856.tar.xz |
ddns.php: remove old .v4 and .v6 entries, too
-rw-r--r-- | ddns.php | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -105,6 +105,16 @@ "prereq yxrrset " . $domain . ".ddns.eckner.net IN " . $rrType . "\n" . "update delete " . $domain . ".ddns.eckner.net IN " . $rrType . "\n" . "send\n"; + if ($rrType == 'A') + $updateCommand .= + "prereq yxrrset " . $domain . ".v4.ddns.eckner.net IN " . $rrType . "\n" . + "update delete " . $domain . ".v4.ddns.eckner.net IN " . $rrType . "\n" . + "send\n"; + else + $updateCommand .= + "prereq yxrrset " . $domain . ".v6.ddns.eckner.net IN " . $rrType . "\n" . + "update delete " . $domain . ".v6.ddns.eckner.net IN " . $rrType . "\n" . + "send\n"; foreach ($filters as $filter) { foreach (array('', 'non-') as $filter_prefix) { $updateCommand .= @@ -157,6 +167,8 @@ pclose($pin); +echo $updateCommand; + file_put_contents('/srv/http/vhosts/eckner.net/ddns/log', $logContent, FILE_APPEND | LOCK_EX); print "updated ips for domain \"" . $domain . ".ddns.eckner.net\": " . implode($ips,", ") . "\n"; |