diff options
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 |