summaryrefslogtreecommitdiffstats
path: root/etc/inc/dyndns.class
diff options
context:
space:
mode:
authorErik Kristensen <ekristen@pfsense.org>2005-07-17 15:59:22 +0000
committerErik Kristensen <ekristen@pfsense.org>2005-07-17 15:59:22 +0000
commit0dd2a0f47eaeea97bf6e2aa90ebff6c9164cba91 (patch)
tree57022ea6ace329c2513a907fc1f872c7ceeaa450 /etc/inc/dyndns.class
parent588b7fc5f4cc2f707a15a987d0eb36656232b3d9 (diff)
downloadpfsense-0dd2a0f47eaeea97bf6e2aa90ebff6c9164cba91.zip
pfsense-0dd2a0f47eaeea97bf6e2aa90ebff6c9164cba91.tar.gz
added support for dyndns.org static and custom entries. fixed dhs.org so it will work now.
Diffstat (limited to 'etc/inc/dyndns.class')
-rw-r--r--etc/inc/dyndns.class103
1 files changed, 89 insertions, 14 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class
index 6f11dd1..2d6a5b2 100644
--- a/etc/inc/dyndns.class
+++ b/etc/inc/dyndns.class
@@ -1,13 +1,17 @@
<?
/*
- * PHP.updateDNS
+ * PHP.updateDNS (pfSense version)
*
* +====================================================+
* Services Supported:
- * - DynDns (dyndns.org)
+ * - DynDns (dyndns.org) [dynamic, static, custom)
* - DHSDns (dhs.org)
* - No-IP (no-ip.com)
* - EasyDNS (easydns.com)
+ * - DHS (www.dhs.org)
+ * - HN (hn.org)
+ * - DynS (dyns.org)
+ * - ZoneEdit (zoneedit.com)
* +----------------------------------------------------+
* Requirements:
* - PHP version 4.0.2 or higher with CURL Library
@@ -22,19 +26,21 @@
* - _detectChange()
* - _debug()
* +----------------------------------------------------+
- * DynDNS - Last Tested: 12 July 2005
- * No-IP - Last Tested: 12 July 2005
- * HN.org - Last Tested: 12 July 2005
- * EasyDNS - Last Tested: NEVER
- * DHS - Last Tested: 12 July 2005
- * ZoneEdit - Last Tested: NEVER
- * Dyns - Last Tested: NEVER
+ * DynDNS Dynamic - Last Tested: 12 July 2005
+ * DynDNS Static - Last Tested: NEVER
+ * DynDNS Custom - Last Tested: NEVER
+ * No-IP - Last Tested: 12 July 2005
+ * HN.org - Last Tested: 12 July 2005
+ * EasyDNS - Last Tested: NEVER
+ * DHS - Last Tested: 12 July 2005
+ * ZoneEdit - Last Tested: NEVER
+ * Dyns - Last Tested: NEVER
* +====================================================+
*
* @author E.Kristensen
* @link http://www.idylldesigns.com/projects/phpdns/
- * @version 0.5
- * @updated 16 July 05 at 17:59:12 GMT
+ * @version 0.6
+ * @updated 17 July 05 at 16:49:23 GMT
*
*/
@@ -50,13 +56,14 @@
var $_dnsIP;
var $_dnsWildcard;
var $_dnsMX;
+ var $_dnsBackMX;
var $status;
/*
* Public Constructor Function (added 12 July 05) [beta]
* - Gets the dice rolling for the update.
*/
- function updatedns ($dnsService = '', $dnsHost = '', $dnsUser = '', $dnsPass = '', $dnsWildcard = '', $dnsMX = '') {
+ function updatedns ($dnsService = '', $dnsHost = '', $dnsUser = '', $dnsPass = '', $dnsWildcard = 'OFF', $dnsMX = '', $dnsBackMX = '') {
if (!$dnsService) $this->_error(2);
if (!$dnsUser) $this->_error(3);
if (!$dnsPass) $this->_error(4);
@@ -72,6 +79,8 @@
$this->_error(10);
} else {
if ($this->_dnsService == 'dyndns' ||
+ $this->_dnsService == 'dyndns-static' ||
+ $this->_dnsService == 'dyndns-custom' ||
$this->_dnsService == 'dhs' ||
$this->_dnsService == 'noip' ||
$this->_dnsService == 'easydns' ||
@@ -103,13 +112,45 @@
$needsIP = FALSE;
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass);
- curl_setopt($ch, CURLOPT_URL, 'https://members.dyndns.org/nic/update?hostname='.$this->_dnsHost);
+ curl_setopt($ch, CURLOPT_URL, 'https://members.dyndns.org/nic/update?hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP.'&wildcard='.$this->_dnsWildcard.'&mx='.$this->_dnsMX.'&backmx=NO');
+ $data = curl_exec($ch);
+ curl_close($ch);
+ $this->_checkStatus($data);
+ break;
+ case 'dyndns-static':
+ $needsIP = FALSE;
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
+ curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass);
+ curl_setopt($ch, CURLOPT_URL, 'https://members.dyndns.org/nic/update?system=statdns&hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP.'&wildcard='.$this->_dnsWildcard.'&mx='.$this->_dnsMX.'&backmx=NO');
+ $data = curl_exec($ch);
+ curl_close($ch);
+ $this->_checkStatus($data);
+ break;
+ case 'dyndns-custom':
+ $needsIP = FALSE;
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
+ curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass);
+ curl_setopt($ch, CURLOPT_URL, 'https://members.dyndns.org/nic/update?system=custom&hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP.'&wildcard='.$this->_dnsWildcard.'&mx='.$this->_dnsMX.'&backmx=NO');
$data = curl_exec($ch);
curl_close($ch);
$this->_checkStatus($data);
break;
case 'dhs':
$needsIP = TRUE;
+ $post_data['hostscmd'] = 'edit';
+ $post_data['hostscmdstage'] = '2';
+ $post_data['type'] = '4';
+ $post_data['updatetype'] = 'Online';
+ $post_data['mx'] = $this->_dnsMX;
+ $post_data['mx2'] = '';
+ $post_data['txt'] = '';
+ $post_data['offline_url'] = '';
+ $post_data['cloak'] = 'Y';
+ $post_data['cloak_title'] = '';
+ $post_data['ip'] = $this->_dnsIP;
+ $post_data['domain'] = 'dyn.dhs.org';
+ $post_data['hostname'] = $this->_dnsHost;
+ $post_data['submit'] = 'Update';
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_URL, 'https://members.dhs.org/nic/hosts');
curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass);
@@ -130,7 +171,7 @@
$needsIP = TRUE;
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass);
- curl_setopt($ch, CURLOPT_URL, 'http://members.easydns.com/dyn/dyndns.php?hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP);
+ curl_setopt($ch, CURLOPT_URL, 'http://members.easydns.com/dyn/dyndns.php?hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP.'&wildcard='.$this->_dnsWildcard.'&mx='.$this->_dnsMX.'&backmx='.$this->_dnsBackMX);
$data = curl_exec($ch);
curl_close($ch);
$this->_checkStatus($data);
@@ -185,6 +226,34 @@
$this->_debug($data);
}
break;
+ case 'dyndns-static':
+ if (preg_match('/notfqdn/i', $data)) {
+ $status = "phpDynDNS: (Error) Not A FQDN!";
+ } else if (preg_match('/nochg/i', $data)) {
+ $status = "phpDynDNS: (Success) No Change In IP Address";
+ } else if (preg_match('/good/i', $data)) {
+ $status = "phpDynDNS: (Success) IP Address Changed Successfully!";
+ } else if (preg_match('/noauth/i', $data)) {
+ $status = "phpDynDNS: (Error) User Authorization Failed";
+ } else {
+ $status = "phpDynDNS: (Unknown Response)";
+ $this->_debug($data);
+ }
+ break;
+ case 'dyndns-custom':
+ if (preg_match('/notfqdn/i', $data)) {
+ $status = "phpDynDNS: (Error) Not A FQDN!";
+ } else if (preg_match('/nochg/i', $data)) {
+ $status = "phpDynDNS: (Success) No Change In IP Address";
+ } else if (preg_match('/good/i', $data)) {
+ $status = "phpDynDNS: (Success) IP Address Changed Successfully!";
+ } else if (preg_match('/noauth/i', $data)) {
+ $status = "phpDynDNS: (Error) User Authorization Failed";
+ } else {
+ $status = "phpDynDNS: (Unknown Response)";
+ $this->_debug($data);
+ }
+ break;
case 'dhs':
break;
case 'noip':
@@ -363,6 +432,12 @@
case 'dyndns':
$time = '2419200';
break;
+ case 'dyndns-static':
+ $time = '2419200';
+ break;
+ case 'dyndns-custom':
+ $time = '2419200';
+ break;
case 'dhs':
$time = '2419200';
break;
OpenPOWER on IntegriCloud