From 2206f1b90f96ad40695a61baddc9958298075d5e Mon Sep 17 00:00:00 2001 From: Mathias Andersson Date: Thu, 14 Nov 2013 22:05:22 +0100 Subject: Added support for City Network to Dynamic DNS. City Network is a Swedish web hosting company. They provide a dynamic DNS service for their customers. This service uses the dyndns2 protocol. --- etc/inc/dyndns.class | 36 ++++++++++++++++++++++++++++++++++++ etc/inc/services.inc | 4 ++-- 2 files changed, 38 insertions(+), 2 deletions(-) (limited to 'etc') diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index 96a4353..49c5077 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -29,6 +29,7 @@ * - CloudFlare (www.cloudflare.com) * - Eurodns (eurodns.com) * - GratisDNS (gratisdns.dk) + * - City Network (citynetwork.se) * +----------------------------------------------------+ * Requirements: * - PHP version 4.0.2 or higher with the CURL Library and the PCRE Library @@ -70,6 +71,7 @@ * Eurodns - Last Tested: 27 June 2013 * GratisDNS - Last Tested: 15 August 2012 * OVH DynHOST - Last Tested: NEVER + * City Network - Last Tested: 13 November 2013 * +====================================================+ * * @author E.Kristensen @@ -238,6 +240,7 @@ case 'eurodns': case 'gratisdns': case 'ovh-dynhost': + case 'citynetwork': $this->_update(); if($this->_dnsDummyUpdateDone == true) { // If a dummy update was needed, then sleep a while and do the update again to put the proper address back. @@ -657,6 +660,20 @@ $port = ":" . $this->_dnsPort; curl_setopt($ch, CURLOPT_URL, $server .$port . '?system=dyndns&hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP . '&wildcard='.$this->_dnsWildcard . '&mx=' . $this->_dnsMX . '&backmx=NO'); break; + case 'citynetwork': + $needsIP = TRUE; + if ($this->_dnsVerboseLog) + log_error("City Network: ({$this->_dnsHost}) DNS update() starting."); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + $server = 'https://dyndns.citynetwork.se/nic/update'; + $port = ""; + if($this->_dnsServer) + $server = $this->_dnsServer; + if($this->_dnsPort) + $port = ":" . $this->_dnsPort; + curl_setopt($ch, CURLOPT_URL, $server .$port . '?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); + break; default: break; } @@ -706,6 +723,25 @@ $this->_debug($data); } break; + case 'citynetwork': + if (preg_match('/notfqdn/i', $data)) { + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Not A FQDN!"; + } else if (preg_match('/nohost/i', $data)) { + $status = "phpDynDNS ({$this->_dnsHost}): (Error) No such host"; + } else if (preg_match('/nochg/i', $data)) { + $status = "phpDynDNS ({$this->_dnsHost}): (Success) No Change In IP Address"; + $successful_update = true; + } else if (preg_match('/good/i', $data)) { + $status = "phpDynDNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully! (".$this->_dnsIP.")"; + $successful_update = true; + } else if (preg_match('/badauth/i', $data)) { + $status = "phpDynDNS ({$this->_dnsHost}): (Error) User Authorization Failed"; + } else { + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); + $this->_debug($data); + } + break; case 'ovh-dynhost': case 'dyndns': if (preg_match('/notfqdn/i', $data)) { diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 6f01d2f..9feacb6 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -38,8 +38,8 @@ pfSense_MODULE: utils */ -define('DYNDNS_PROVIDER_VALUES', 'dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip noip-free ods zoneedit loopia freedns dnsexit opendns namecheap he-net he-net-v6 he-net-tunnelbroker selfhost route53 cloudflare custom custom-v6 eurodns gratisdns ovh-dynhost'); -define('DYNDNS_PROVIDER_DESCRIPTIONS', 'DNS-O-Matic,DynDNS (dynamic),DynDNS (static),DynDNS (custom),DHS,DyNS,easyDNS,No-IP,No-IP (free),ODS.org,ZoneEdit,Loopia,freeDNS,DNSexit,OpenDNS,Namecheap,HE.net,HE.net (v6),HE.net Tunnelbroker,SelfHost,Route 53,CloudFlare,Custom,Custom (v6),Euro Dns,GratisDNS,OVH DynHOST'); +define('DYNDNS_PROVIDER_VALUES', 'dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip noip-free ods zoneedit loopia freedns dnsexit opendns namecheap he-net he-net-v6 he-net-tunnelbroker selfhost route53 cloudflare custom custom-v6 eurodns gratisdns ovh-dynhost citynetwork'); +define('DYNDNS_PROVIDER_DESCRIPTIONS', 'DNS-O-Matic,DynDNS (dynamic),DynDNS (static),DynDNS (custom),DHS,DyNS,easyDNS,No-IP,No-IP (free),ODS.org,ZoneEdit,Loopia,freeDNS,DNSexit,OpenDNS,Namecheap,HE.net,HE.net (v6),HE.net Tunnelbroker,SelfHost,Route 53,CloudFlare,Custom,Custom (v6),Euro Dns,GratisDNS,OVH DynHOST,City Network'); /* implement ipv6 route advertising deamon */ function services_radvd_configure() { -- cgit v1.1