diff options
author | Christopher Fazendin <cfazendin@gmail.com> | 2015-04-27 21:45:13 -0500 |
---|---|---|
committer | Christopher Fazendin <cfazendin@gmail.com> | 2015-04-27 21:46:01 -0500 |
commit | 6c92b37851b4f23c82ce6e7f1094b9db1adc4b44 (patch) | |
tree | ad4d826c1918d2e314346d4ba6dba9e0c76d47e0 /etc | |
parent | 60dee68b1d3344a4d98eb7a33b240274c86303b1 (diff) | |
download | pfsense-6c92b37851b4f23c82ce6e7f1094b9db1adc4b44.zip pfsense-6c92b37851b4f23c82ce6e7f1094b9db1adc4b44.tar.gz |
Add Google Domains to Dynamic DNS service.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/dyndns.class | 46 | ||||
-rw-r--r-- | etc/inc/services.inc | 4 |
2 files changed, 48 insertions, 2 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index 686d8f2..6081ed9 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -32,6 +32,7 @@ * - City Network (citynetwork.se) * - GleSYS (glesys.com) * - DNSimple (dnsimple.com) + * - Google Domains (domains.google.com) * +----------------------------------------------------+ * Requirements: * - PHP version 4.0.2 or higher with the CURL Library and the PCRE Library @@ -76,6 +77,7 @@ * City Network - Last Tested: 13 November 2013 * GleSYS - Last Tested: 3 February 2015 * DNSimple - Last Tested: 09 February 2015 + * Google Domains - Last Tested: 27 April 2015 * +====================================================+ * * @author E.Kristensen @@ -249,6 +251,7 @@ case 'ovh-dynhost': case 'citynetwork': case 'dnsimple': + case 'googledomains': $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. @@ -740,6 +743,24 @@ curl_setopt($ch, CURLOPT_URL, $server . $this->_dnsHost . '/records/' . $this->_dnsZoneID); curl_setopt($ch, CURLOPT_POSTFIELDS, $jsondata); break; + case 'googledomains': + $needsIP = FALSE; + if ($this->_dnsVerboseLog) { + log_error("Google Domains: ({$this->_dnsHost}) DNS update() starting."); + } + $post_data['username:password'] = $this->_dnsUser . ':' . $this->_dnsPass; + $post_data['hostname'] = $this->_dnsHost; + $post_data['myip'] = $this->_dnsIP; + $post_data['offline'] = 'no'; + + $server = "https://domains.google.com/nic/update"; + $port = ""; + curl_setopt($ch, CURLOPT_SSLVERSION, 6); + curl_setopt($ch, CURLOPT_USERAGENT, 'Chrome/41.0'); + curl_setopt($ch, CURLOPT_URL, 'https://domains.google.com/nic/update'); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); + break; default: break; } @@ -1288,6 +1309,31 @@ $this->_debug($body); } break; + case 'googledomains': + if (preg_match('/notfqdn/i', $data)) { + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Not A FQDN"; + } 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 if (preg_match('/nohost/i', $data)) { + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Hostname does not exist or DynDNS not enabled"; + } else if (preg_match('/badagent/i', $data)) { + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Bad request"; + } else if (preg_match('/abuse/i', $data)) { + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Dynamic DNS access has been blocked!"; + } else if (preg_match('/911/i', $data)) { + $status = "phpDynDNS ({$this->_dnsHost}): (Error) Error on Google's end, retry in 5 minutes"; + } else { + $status = "phpDynDNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("phpDynDNS ({$this->_dnsHost}): PAYLOAD: {$data}"); + $this->_debug($data); + } + break; } if ($successful_update == true) { diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 057f091..ab7abe8 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -38,8 +38,8 @@ pfSense_MODULE: utils */ -define('DYNDNS_PROVIDER_VALUES', 'citynetwork cloudflare custom custom-v6 dhs dnsexit dnsimple dnsomatic dyndns dyndns-custom dyndns-static dyns easydns eurodns freedns glesys gratisdns he-net he-net-v6 he-net-tunnelbroker loopia namecheap noip noip-free ods opendns ovh-dynhost route53 selfhost zoneedit'); -define('DYNDNS_PROVIDER_DESCRIPTIONS', 'City Network,CloudFlare,Custom,Custom (v6),DHS,DNSexit,DNSimple,DNS-O-Matic,DynDNS (dynamic),DynDNS (custom),DynDNS (static),DyNS,easyDNS,Euro Dns,freeDNS,GleSYS,GratisDNS,HE.net,HE.net (v6),HE.net Tunnelbroker,Loopia,Namecheap,No-IP,No-IP (free),ODS.org,OpenDNS,OVH DynHOST,Route 53,SelfHost,ZoneEdit'); +define('DYNDNS_PROVIDER_VALUES', 'citynetwork cloudflare custom custom-v6 dhs dnsexit dnsimple dnsomatic dyndns dyndns-custom dyndns-static dyns easydns eurodns freedns glesys googledomains gratisdns he-net he-net-v6 he-net-tunnelbroker loopia namecheap noip noip-free ods opendns ovh-dynhost route53 selfhost zoneedit'); +define('DYNDNS_PROVIDER_DESCRIPTIONS', 'City Network,CloudFlare,Custom,Custom (v6),DHS,DNSexit,DNSimple,DNS-O-Matic,DynDNS (dynamic),DynDNS (custom),DynDNS (static),DyNS,easyDNS,Euro Dns,freeDNS,GleSYS,Google Domains,GratisDNS,HE.net,HE.net (v6),HE.net Tunnelbroker,Loopia,Namecheap,No-IP,No-IP (free),ODS.org,OpenDNS,OVH DynHOST,Route 53,SelfHost,ZoneEdit'); /* implement ipv6 route advertising daemon */ function services_radvd_configure($blacklist = array()) { |