diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class index c117a9d07..71ec26280 100644 --- a/src/etc/inc/dyndns.class +++ b/src/etc/inc/dyndns.class @@ -32,6 +32,7 @@ * - GratisDNS (gratisdns.dk) * - City Network (citynetwork.se) * - Duck DNS (duckdns.org) + * - Google Domains (domains.google.com) * +----------------------------------------------------+ * Requirements: * - PHP version 4.0.2 or higher with the CURL Library and the PCRE Library @@ -75,6 +76,7 @@ * OVH DynHOST - Last Tested: NEVER * City Network - Last Tested: 13 November 2013 * Duck DNS - Last Tested: 04 March 2015 + * Google Domains - Last Tested: 20 February 2017 * +====================================================+ * * @author E.Kristensen @@ -248,6 +250,7 @@ case 'eurodns': case 'gratisdns': case 'ovh-dynhost': + case 'googledomains': case 'citynetwork': case 'duckdns': $this->_update(); @@ -702,6 +705,19 @@ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_URL, $server . '?domains=' . str_replace('.duckdns.org', '', $this->_dnsHost) . '&token=' . $this->_dnsUser); break; + case 'googledomains': + if ($this->_dnsVerboseLog) + log_error("Google Domains: ({$this->_dnsHost}): DNS update() starting."); + $server = "https://domains.google.com/nic/update"; + $post_data['hostname'] = $this->_dnsHost; + $post_data['myip'] = $this->_dnsIP; + $post_data['offline'] = 'no'; + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); + curl_setopt($ch, CURLOPT_URL, $server); + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + break; default: break; } @@ -1208,6 +1224,30 @@ $this->_debug($data); } break; + case 'googledomains': + if (preg_match('/notfqdn/i', $data)) { + $status = "Dynamic DNS: (Error) Not a FQDN"; + } else if (preg_match('/nochg/i', $data)) { + $status = "Dynamic DNS: (Success) No change in IP address"; + $successful_update = true; + } else if (preg_match('/good/i', $data)) { + $status = "Dynamic DNS: (Success) IP address updated successfully"; + $successful_update = true; + } else if (preg_match('/badauth/i', $data)) { + $status = "Dynamic DNS: (Error) Authentication failed"; + } else if (preg_match('/nohost/i', $data)) { + $status = "Dynamic DNS: (Error) Hostname does not exist or does not have dynamic DNS enabled"; + } else if (preg_match('/badagent/i', $data)) { + $status = "Dynamic DNS: (Error) Bad request"; + } else if (preg_match('/abuse/i', $data)) { + $status = "Dynamic DNS: (Error) Access has been blocked for abuse"; + } else if (preg_match('/911/i', $data)) { + $status = "Dynamic DNS: (Error) Server-side error or maintenance"; + } else { + $status = "Dynamic DNS: (Unknown Response)"; + log_error("Dynamic DNS: PAYLOAD: {$data}"); + $this->_debug($data); + } } if($successful_update == true) { diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc index afc986e60..4527d9ce0 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -1553,6 +1553,7 @@ function services_dyndns_list() 'eurodns' => 'EuroDNS', 'freedns' => 'freeDNS', 'gratisdns' => 'GratisDNS', + 'googledomains' => 'Google Domains', 'he-net' => 'HE.net', 'he-net-v6' => 'HE.net (v6)', 'he-net-tunnelbroker' => 'HE.net Tunnelbroker',