model for a new provider

13 views
Skip to first unread message

Hamish Moffatt

unread,
Jun 9, 2025, 3:54:02 AMJun 9
to DNSControl-discuss
Hi Tom and all,

I was starting to implement support for a new provider with a fairly
sane looking HTTP API, which would be a good implementation to start from?

https://api.binarylane.com.au/reference/#tag/NameserverNotes


Thanks

Hamish

Tom Limoncelli

unread,
Jun 9, 2025, 8:37:06 AMJun 9
to Hamish Moffatt, DNSControl-discuss
That's an excellent question!

Thinking out loud: I need to write a template to copy for new providers that demonstrates the best practices for which functions go in which filesnames, etc.  This might be a good opportunity to create a standard and migrate all existing providers to comply with the standard.

In the meantime, dnscontrol/providers/porkbun has a good layout.  Loopia does too, but it uses diff.NewCompat() which is old.  Do not copy the format of cloudflare... that was written long before we knew what we were doing (I'm mocking myself here).

Best,
Tom

--
You received this message because you are subscribed to the Google Groups "DNSControl-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dnscontrol-disc...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dnscontrol-discuss/69d9f834-85ba-4e45-a404-330f9a34929f%40risingsoftware.com.

Hamish Moffatt

unread,
Jun 10, 2025, 10:24:36 PMJun 10
to Tom Limoncelli, DNSControl-discuss
Well, that was easy! From Porkbun I was able to get my new provider going for some basic functions in a few hours. I haven't tried the unit tests yet.

I'm a bit stuck on handling of the nameservers though. My provider does not include the apex NS records in the record list, nor can they be modified. I haven't declared any nameservers in my dnsconfig.js. When I run dnscontrol, I get:

INFO#1: Skipping registrar "none": No nameservers declared for domain "my-test-zone.dev". Add {no_ns:'true'} to force


var REG_NONE = NewRegistrar("none");    // No registrar.
var DNS_BINARYLANE = NewDnsProvider("binarylane");

D("my-test-zone.dev", REG_NONE, DnsProvider(DNS_BINARYLANE),
    DefaultTTL(3600),
    A("@", "1.1.1.1"),
    A("wwww", "1.1.1.2"),
    A("wwww2", "1.1.1.1")
);


I tried injecting NS records into the records list in GetZoneRecords(), but then dnscontrol saw those as needing to be deleted.

I don't declare my nameservers when using the Cloudflare provider and it doesn't warn about this there, so I don't know what's different. Any hints?

Thanks,

Hamish

Tom Limoncelli

unread,
Jun 11, 2025, 5:16:11 AMJun 11
to Hamish Moffatt, DNSControl-discuss
On Tue, Jun 10, 2025 at 10:24 PM Hamish Moffatt <ham...@risingsoftware.com> wrote:
Well, that was easy! From Porkbun I was able to get my new provider going for some basic functions in a few hours. I haven't tried the unit tests yet.

Good to hear! 
 
I'm a bit stuck on handling of the nameservers though. My provider does not include the apex NS records in the record list, nor can they be modified. I haven't declared any nameservers in my dnsconfig.js.

Is GetNameservers() defined?

(Doing this from memory...)   The GetNameservers() returns the parent nameservers.  That info comes from the registrar, not the NS records in the domain.  The two should match, and if they don't DNSControl will try to update the zone.

I tried injecting NS records into the records list in GetZoneRecords(), but then dnscontrol saw those as needing to be deleted.

Sounds like GetNameservers() is returning an empty list and DNSControl is, therefore, trying to  update the zone to match (i.e. delete the NS records).
 
I don't declare my nameservers when using the Cloudflare provider and it doesn't warn about this there, so I don't know what's different. Any hints?

With Cloudflare, GetNameservers() is defined, thus everything is automatic.  The NAMESERVER() commands are only needed when GetNameservers() isn't implemented.

Hope that helps!

Tom 

Hamish Moffatt

unread,
Jun 11, 2025, 5:26:14 AMJun 11
to Tom Limoncelli, DNSControl-discuss
On 11/6/25 19:15, 'Tom Limoncelli' via DNSControl-discuss wrote:


On Tue, Jun 10, 2025 at 10:24 PM Hamish Moffatt <ham...@risingsoftware.com> wrote:
Well, that was easy! From Porkbun I was able to get my new provider going for some basic functions in a few hours. I haven't tried the unit tests yet.

Good to hear! 
 
I'm a bit stuck on handling of the nameservers though. My provider does not include the apex NS records in the record list, nor can they be modified. I haven't declared any nameservers in my dnsconfig.js.

Is GetNameservers() defined?

Thanks, there was a logic error in GetNameservers() resulting in it not returning the list. It's working now.

Unfortunately I think this project is a non-starter as the provider seems to have a bunch of restrictions or bugs. I can't edit the TTL of anything, and I can't have an MX record with a label part of "foo.bar" (though an A record allows it), for example.


Hamish

Tom Limoncelli

unread,
Jun 11, 2025, 6:05:45 AMJun 11
to Hamish Moffatt, Tom Limoncelli, DNSControl-discuss
On Wed, Jun 11, 2025 at 5:26 AM 'Hamish Moffatt' via DNSControl-discuss <dnscontro...@googlegroups.com> wrote:
Thanks, there was a logic error in GetNameservers() resulting in it not returning the list. It's working now.

Good to know!
 

Unfortunately I think this project is a non-starter as the provider seems to have a bunch of restrictions or bugs. I can't edit the TTL of anything, and I can't have an MX record with a label part of "foo.bar" (though an A record allows it), for example.


Yeah, that sounds pretty limiting.

Tom

--
Email: t...@whatexit.org    Work: tlimo...@StackOverflow.com
Blog:  http://EverythingSysadmin.com/
Reply all
Reply to author
Forward
0 new messages