ispconfig DDNS-update

https://github.com/DIXINFOR/ddns-update-for-ispconfig

 

Crontab on local machine

*/30 * * * * wget –no-check-certificate ‘https://server.example.com:8080/ddns-update.php?username=user&password=password&hostname=intranet.example.com

Install and mods

mkdir -p ~/app/ispconfig

cd app/ispconfig/


git clone https://github.com/DIXINFOR/ddns-update-for-ispconfig.git

cd /usr/local/ispconfig/interface/web

cp ~/app/ispconfig/ddns-update-for-ispconfig/index.php ddns-update.php
cp ~/app/ispconfig/ddns-update-for-ispconfig/log.inc.php ddns-log.inc.php



--- /root/app/ddns-update-for-ispconfig/log.inc.php	2016-04-01 14:05:06.485384000 -0300
+++ /usr/local/ispconfig/interface/web/ddns-log.inc.php	2016-04-01 15:25:16.801384000 -0300
@@ -4,7 +4,7 @@
     private $file; 
     
 	function __construct($name) {
-        $this->file = "log_".str_replace('.', '_', $name).".txt" ; 
+        $this->file = "/var/log/ddns-log_".str_replace('.', '_', $name).".txt" ; 
     }
 	
     function debug($log) {
@@ -22,4 +22,4 @@
     }
  
 }
-?>
\ No newline at end of file
+?>
--- /root/app/ddns-update-for-ispconfig/index.php	2016-04-01 14:05:06.485384000 -0300
+++ /usr/local/ispconfig/interface/web/ddns-update.php	2016-04-01 14:32:43.449384000 -0300
@@ -1,9 +1,9 @@
 <?php
-require_once('log.inc.php');
+require_once('ddns-log.inc.php');
 
 // ISPConfig URL for REMOTE API
-$soap_location = 'https://10.0.0.251:8080/remote/index.php';
-$soap_uri = 'https://10.0.0.251:8080/remote/';
+$soap_location = 'https://localhost:8080/remote/index.php';
+$soap_uri = 'https://localhost:8080/remote/';
 
 // Exception List
 $exception = array('example.com','example2.com.');
@@ -136,7 +136,7 @@
 		$log->debug("End content");
 		// check if record is A IPv4 (not cname, mx, txt, ...)
 		$log->debug("Check record type");
-		if ($dns_record[0]['type']!='a'){
+		if ($dns_record[0]['type']!='A'){
 			$log->debug("Record type is not A. You can only update a A record");
 			echo "dnserr";
 			exit;
@@ -182,4 +182,4 @@
 }
 
 
-?>
\ No newline at end of file
+?>