summaryrefslogtreecommitdiff
path: root/ddns.php
diff options
context:
space:
mode:
Diffstat (limited to 'ddns.php')
-rw-r--r--ddns.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/ddns.php b/ddns.php
index c3694b9..f3becb4 100644
--- a/ddns.php
+++ b/ddns.php
@@ -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