StackExchange / dnscontrol

Infrastructure as code for DNS!
https://dnscontrol.org/
MIT License
3.07k stars 389 forks source link

Provider request: AutoDNS #1323

Closed arnoschoon closed 1 year ago

arnoschoon commented 2 years ago

Hi,

we're using AutoDNS (a platform from InterNetX) to manage most of our DNS zones.

They offer a full-fledged API (https://github.com/InterNetX/domainrobot-api) and since we're on the verge of migrating zones from other systems I'd like to take the opportunity to put DNSControl in the middle.

I'd like to take a stab at the initial implementation of zone management. I've started out with reading https://stackexchange.github.io/dnscontrol/writing-providers and since it mentions a Github issue related to the request for this provider I've started here to prevent confronting you with a PR.

tlimoncelli commented 2 years ago

Sounds great! Let me know if you have any questions. I'd be glad to assist!

arnoschoon commented 2 years ago

Hi @tlimoncelli,

With https://github.com/arnoschoon/dnscontrol/commit/d44997a7f558690b57eab540acca907290cc95e2 I've tried to implement a basic provider that is capable of notifying me of changes that are going to happen.

I'll continue with the actual updating tomorrow, but working on this already raised a question. Should new provider be tested extensively in regards to their behavior when it comes to long TXT records or other edge cases?

tlimoncelli commented 2 years ago

I looked at the code and things are looking good so far!

TXT records: Fix the edge cases later. Each provider should have a file called auditrecords.go which detects TXT records that the provider doesn't support. Look at the other providers for examples. (I need to add this info to the documentation). Start by being the most restrictive and work from there.

The integration tests (go test -v -verbose -provider AUTODNS) will help find any edge cases.

Tom

arnoschoon commented 2 years ago

Hi @tlimoncelli ,

thanks for your feedback, I'm trying to fix all of your remarks in my code, so maybe a few commits will pop up.

In the meantime I was wondering how I could implement create-domains and if that is a DNS provider or registrar thing. I'd like this tool to create the new zones in AutoDNS (they are converted to DJS from BIND), in total little over 300 domains should be created.

arnoschoon commented 2 years ago

I think we should use https://github.com/StackExchange/dnscontrol/pull/1336 for an initial implementation of the provider (I'll focus on fixing any remarks) and add a possible additional feature like create-domains in a separate issue/PR.

tlimoncelli commented 2 years ago

The create-domains command just populates a domain in a DNS provider that requires that step, such as ROUTE53. It isn't for purchasing domains. (the name could be better)

If you need to convert many zones, look at "dnscontrol get-zones" which can read BIND files and output dnsconfig.js-style files.

arnoschoon commented 2 years ago

That's what I'm looking for, the domains are already purchased but their respective zones miss.

What methods do I need to implement to support creation of zones in my provider?

tlimoncelli commented 2 years ago

That's what I'm looking for, the domains are already purchased but their respective zones miss.

Oh good!

What methods do I need to implement to support creation of zones in my provider?

Complete the DomainCreator interface in providers.go. That should be all!

tlimoncelli commented 1 year ago

This can be closed, right?