Hello,
I am developing a provider for Akamai's
Edge DNS.
I've got up-to-date DnsControl source:
$ date
Thu May 27 12:22:25 EDT 2021
$ git pull
Already up to date.
$ /Users/svernick/go/bin/dnscontrol -v version
dnscontrol v3.9.0-dev
Edge DNS automatically creates SOA and top-level NS records. SOA should not be managed by DnsControl:
providers.CanUseSOA: providers.Cannot(),
HTTP/1.1 200 OK
{
"recordsets": [
{
"rdata": [
],
"ttl": 86400,
"type": "SOA"
},
{
"rdata": [
],
"ttl": 86400,
"type": "NS"
}
]
}
This is my dnsconfig.js:
var REG_NONE = NewRegistrar('none', 'NONE'); // No registrar.
var DNS_AKAMAI = NewDnsProvider('akamai', 'AKAMAI');
);
I would expect DnsControl to not change the existing SOA or NS records.
This is DnsControl preview output:
$ /Users/svernick/go/bin/dnscontrol -v preview
----- Getting nameservers from: akamai
----- DNS Provider: akamai...2 corrections
----- Registrar: none...0 corrections
Done. 2 corrections.
Issue 1. Delete SOA:
DnsControl should not delete the SOA record. If I try to add the matching SOA to dnsconfig.js:
then I correctly get an error:
$ /Users/svernick/go/bin/dnscontrol -v preview
2021/05/27 11:36:35 printIR.go:88: 1 Validation errors:
2021/05/27 11:36:35 printIR.go:94: ERROR: domain svernick.net uses SOA records, but DNS provider type AKAMAI does not support them exiting due to validation errors
So, I am forced to change "CanUseSOA" to prevent deletion of the SOA record:
providers.CanUseSOA: providers.Can(),
With these changes, DnsControl no longer tries to delete the automatically-generated SOA record:
$ /Users/svernick/go/bin/dnscontrol -v preview
----- Getting nameservers from: akamai
----- DNS Provider: akamai...1 correction
----- Registrar: none...0 corrections
Done. 1 corrections.
Issue 2: NS modifications
DnsControl should not modify the automatically-generated top-level NS records.
To prevent modification, I am forced to specify the TTL in dnsconfig.js:
With this change, DnsControl no longer tries to modify the automatically-generated NS records:
$ /Users/svernick/go/bin/dnscontrol -v preview
----- Getting nameservers from: akamai
----- DNS Provider: akamai...0 corrections
----- Registrar: none...0 corrections
Done. 0 corrections.
Issue 3: NS duplication
"If dnsconfig.js has 1 or more NAMESERVER() commands for a domain, it will use the API to add those nameservers (unless, of course, they already exist)."
To test this, I add a NAMESERVER() command for an existing NS record:
DnsControl tries to add a new NS record:
$ /Users/svernick/go/bin/dnscontrol -v preview
----- Getting nameservers from: akamai
----- DNS Provider: akamai...1 correction
----- Registrar: none...0 corrections
Done. 1 corrections.
This is because "DetermineNameservers" (nameservers.go):
-- Gets configured nameservers from dnsconfig.js (line 17):
// always take explicit
ns := dc.Nameservers
-- Gets existing nameservers from the provider (line 25):
nss, err := dnsProvider.Driver.GetNameservers(dc.Name)
-- Concatenates the two lists (slices) without removing duplicates (line 43):
for i := 0; i < take; i++ {
ns = append(ns, nss[i])
}
Are these bugs? If so, how do I submit bug reports? If not, please provide further information.
Thank you!
/Steve