summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-03-04 08:53:28 +0100
committerErich Eckner <git@eckner.net>2020-03-04 08:53:28 +0100
commitaa208e9dd52d91e7144867982dce31d6f364d856 (patch)
treee16e3712518929cf535b7698b50665d08ea86198
parent453088811146e223ea3a5589a2e9f53a89d4b3bc (diff)
downloadddns-aa208e9dd52d91e7144867982dce31d6f364d856.tar.xz
ddns.php: remove old .v4 and .v6 entries, too
-rw-r--r--ddns.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/ddns.php b/ddns.php
index f3becb4..3b8793c 100644
--- a/ddns.php
+++ b/ddns.php
@@ -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";