diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class
index 892e7f0e60..aa481ab072 100644
--- a/src/etc/inc/dyndns.class
+++ b/src/etc/inc/dyndns.class
@@ -998,7 +998,9 @@
$output->domain_records = array();
}
foreach($output->domain_records as $dnsRecord) {
- if ($this->_dnsHost == $dnsRecord->name) {
+ // NS records are named @ in DO's API, so check type as well
+ // https://redmine.pfsense.org/issues/9171
+ if ($this->_dnsHost == $dnsRecord->name && $dnsRecord->type == 'A') {
$recordID = $dnsRecord->id;
break;
}
@@ -1845,7 +1847,9 @@
}
break;
case 'digitalocean':
- if (preg_match("/\s200\sOK/i", $header)) {
+ // Creating new records returns an HTTP 201, updating existing records get 200
+ // https://redmine.pfsense.org/issues/9171
+ if (preg_match("/HTTP\/2\s20[0,1]/i", $header)) {
$status = $status_intro . $success_str . gettext("IP Address Updated Successfully!");
$successful_update = true;
} else {
diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php
index 5442adcfeb..2f095324ac 100644
--- a/src/usr/local/www/services_dyndns_edit.php
+++ b/src/usr/local/www/services_dyndns_edit.php
@@ -113,6 +113,8 @@ if ($_POST['save'] || $_POST['force']) {
$host_to_check = $_POST['domainname'];
} elseif ((($pconfig['type'] == "godaddy") || ($pconfig['type'] == "godaddy-v6")) && ($_POST['host'] == '@.' || $_POST['host'] == '@')) {
$host_to_check = $_POST['domainname'];
+ } elseif (($pconfig['type'] == "digitalocean") && ($_POST['host'] == '@.' || $_POST['host'] == '@')) {
+ $host_to_check = $_POST['domainname'];
} else {
$host_to_check = $_POST['host'];
@@ -300,7 +302,7 @@ $group->setHelp('Enter the complete fully qualified domain name. Example: myhost
'GleSYS: Enter the record ID.%1$s' .
'DNSimple: Enter only the domain name.%1$s' .
'Namecheap, Cloudflare, GratisDNS, Hover, ClouDNS, GoDaddy: Enter the hostname and the domain separately, with the domain being the domain or subdomain zone being handled by the provider.%1$s' .
- 'Cloudflare: Enter @ as the hostname to indicate an empty field.', '
');
+ 'Cloudflare and DigitalOcean: Enter @ as the hostname to indicate an empty field.', '
');
$section->add($group);