diff options
author | Erich Eckner <git@eckner.net> | 2020-02-26 08:19:26 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-02-26 08:19:26 +0100 |
commit | 453088811146e223ea3a5589a2e9f53a89d4b3bc (patch) | |
tree | dc3e27a5321bdb2785dd902258f841223d5e1f8e /ddns.php | |
parent | 496c8b518367d63a5a86044e8305ec710ced91dc (diff) | |
download | ddns-453088811146e223ea3a5589a2e9f53a89d4b3bc.tar.xz |
ddns.php: only issue updates for zones that really exist
Diffstat (limited to 'ddns.php')
-rw-r--r-- | ddns.php | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -15,8 +15,15 @@ function reverse_entry($addr) { $addrTeile = explode('.', $addr); + $lp = array_pop($addrTeile); + $subNet = implode('.', $addrTeile); + array_push($addrTeile, $lp); array_reverse($addrTeile); - return implode('.',$addrTeile).'.in-addr.arpa.'; + if (($subNet == '10.0.2') || + ($subNet == '192.168.0') || + ($subNet == '192.168.1')) + return implode('.',$addrTeile).'.in-addr.arpa.'; + return NULL; }; function reverse_zone($addr) { @@ -125,6 +132,8 @@ foreach ($ips as $i => $ip) { if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { $reverse_entry = reverse_entry($ip); + if (!$reverse_entry) + continue; $updateCommand .= "zone ".reverse_zone($ip)."\n"; // delete old record if existing |