Commit graph

71 commits

Author SHA1 Message Date
Jonathan Beliën
5287f96581
Merge 739c01bad9 into 986bc4c5f4 2025-12-05 22:11:00 +01:00
Jiacheng
bcef7f52fc
ALIDNS: Implement ALIDNS Provider (#3878)
<!--
## Before submiting a pull request

Please make sure you've run the following commands from the root
directory.

    bin/generate-all.sh

(this runs commands like "go generate", fixes formatting, and so on)

## Release changelog section

Help keep the release changelog clear by pre-naming the proper section
in the GitHub pull request title.

Some examples:
* CICD: Add required GHA permissions for goreleaser
* DOCS: Fixed providers with "contributor support" table
* ROUTE53: Allow R53_ALIAS records to enable target health evaluation

More examples/context can be found in the file .goreleaser.yml under the
'build' > 'changelog' key.
!-->

https://github.com/StackExchange/dnscontrol/issues/420


Please create the GitHub label 'provider-ALIDNS'

---------

Co-authored-by: Tom Limoncelli <6293917+tlimoncelli@users.noreply.github.com>
2025-12-04 10:55:14 -05:00
tridion
f1b30a1a04
feat: Add IGNORE_EXTERNAL_DNS() for Kubernetes external-dns coexistence (#3869)s
## Summary

This PR adds a new domain modifier `IGNORE_EXTERNAL_DNS()` that
automatically detects and ignores DNS records managed by Kubernetes
[external-dns](https://github.com/kubernetes-sigs/external-dns)
controller.

**Related Issue:** This addresses the feature request discussed in
StackExchange/dnscontrol#935 (Idea: Ownership system), where
@tlimoncelli indicated openness to accepting a PR for this
functionality.

## Problem

When running DNSControl alongside Kubernetes external-dns, users face a
challenge:

- **external-dns** dynamically creates DNS records based on Kubernetes
Ingress/Service resources
- Users cannot use `IGNORE()` because they cannot predict which record
names external-dns will create
- Using `NO_PURGE()` is too broad - it prevents DNSControl from cleaning
up any orphaned records

The fundamental issue is that `IGNORE()` requires static patterns known
at config-time, but external-dns creates records dynamically at runtime.

## Solution

`IGNORE_EXTERNAL_DNS()` solves this by detecting external-dns managed
records at runtime:

```javascript
D("example.com", REG_CHANGEME, DnsProvider(DSP_MY_PROVIDER),
    IGNORE_EXTERNAL_DNS(),  // Automatically ignore external-dns managed records
    A("@", "1.2.3.4"),
    CNAME("www", "@")
);
```

### How It Works

external-dns uses a TXT record registry to track ownership. For each
managed record, it creates a TXT record like:

- `a-myapp.example.com` → TXT containing
`heritage=external-dns,external-dns/owner=...`
- `cname-api.example.com` → TXT containing
`heritage=external-dns,external-dns/owner=...`

This PR:
1. Scans existing TXT records for the `heritage=external-dns` marker
2. Parses the TXT record name prefix (e.g., `a-`, `cname-`) to determine
the managed record type
3. Automatically adds those records to the ignore list during diff
operations

## Changes

| File | Purpose |
|------|---------|
| `models/domain.go` | Add `IgnoreExternalDNS` field to DomainConfig |
| `pkg/js/helpers.js` | Add `IGNORE_EXTERNAL_DNS()` JavaScript helper |
| `pkg/diff2/externaldns.go` | Core detection logic for external-dns TXT
records |
| `pkg/diff2/externaldns_test.go` | Unit tests for detection logic |
| `pkg/diff2/handsoff.go` | Integrate external-dns detection into
handsoff() |
| `pkg/diff2/diff2.go` | Pass IgnoreExternalDNS flag to handsoff() |
| `commands/types/dnscontrol.d.ts` | TypeScript definitions for IDE
support |
| `documentation/.../IGNORE_EXTERNAL_DNS.md` | User documentation |

## Design Philosophy

This follows DNSControl's pattern of convenience builders (like
`M365_BUILDER`, `SPF_BUILDER`, `DKIM_BUILDER`) that make complex
operations simple. Just as those builders abstract away implementation
details, `IGNORE_EXTERNAL_DNS()` abstracts away the complexity of
detecting external-dns managed records.

## Testing

All unit tests pass:
```
go test ./pkg/diff2/... -v  # Tests detection logic
go test ./pkg/js/...        # Tests JS helpers
go build ./...              # Builds successfully
```

## Caveats Documented

- Only supports TXT registry (the default for external-dns)
- Requires external-dns to use default naming conventions
- May need updates if external-dns changes its registry format

---------

Co-authored-by: Tom Limoncelli <6293917+tlimoncelli@users.noreply.github.com>
2025-12-03 08:56:55 -05:00
Tom Limoncelli
d6363cd890
Merge branch 'main' into provider/infomaniak 2025-12-01 09:16:28 -05:00
Sukka
daf5a7a501
VERCEL: Implement Vercel DNS Provider (#3379) (#3542)
Fixes https://github.com/StackExchange/dnscontrol/issues/3379

Thanks to @SukkaW for adding this provider!  Even though you claimed to be "not familiar with Go at all" the new code looks excellent!  Great job!
2025-12-01 08:41:56 -05:00
Jakob Ackermann
1e67585e8f
HETZNER_V2: Add provider for Hetzner DNS API (#3837)
Closes https://github.com/StackExchange/dnscontrol/issues/3787

This PR is adding a `HETZNER_V2` provider for the "new" Hetzner DNS API.

Testing:
- The integration tests are passing.
- Manual testing:
  - `preview` (see diff for existing zone)
- `preview --populate-on-preview` (see full diff for newly created zone)
  - `push` (see full diff; no diff after push)
- `push` (see full diff; no diff after push to newly created zone --
i.e. single pass and done)

```js
var REG_NONE = NewRegistrar('none')
var DSP = NewDnsProvider('HETZNER_V2')

D('testing-2025-11-14-7.dev', REG_NONE, DnsProvider(DSP),
    A('@', '127.0.0.1')
)
```

<details>

```
# push for newly created zone
CONCURRENTLY checking for 1 zone(s)
SERIALLY checking for 0 zone(s)
Waiting for concurrent checking(s) to complete...DONE
******************** Domain: testing-2025-11-14-7.dev
1 correction (HETZNER_V2)
#1: Ensuring zone "testing-2025-11-14-7.dev" exists in "HETZNER_V2"
SUCCESS!
CONCURRENTLY gathering records of 1 zone(s)
SERIALLY gathering records of 0 zone(s)
Waiting for concurrent gathering(s) to complete...DONE
******************** Domain: testing-2025-11-14-7.dev
4 corrections (HETZNER_V2)
#1: ± MODIFY-TTL testing-2025-11-14-7.dev NS helium.ns.hetzner.de. ttl=(3600->300)
± MODIFY-TTL testing-2025-11-14-7.dev NS hydrogen.ns.hetzner.com. ttl=(3600->300)
± MODIFY-TTL testing-2025-11-14-7.dev NS oxygen.ns.hetzner.com. ttl=(3600->300)
SUCCESS!
#2: + CREATE testing-2025-11-14-7.dev A 127.0.0.1 ttl=300
SUCCESS!
Done. 5 corrections.
```
</details>

Feedback for @jooola and @LKaemmerling:
- The SDK was very useful in getting 80% there! Nice! 🎉 
- Footgun:
- The `result` values are not "up-to-date" after waiting for an
`Action`, e.g. `Zone.AuthoritativeNameservers.Assigned` is not set when
`Client.Zone.Create()` returns and the following "wait" will not update
it.
- Taking a step back here: Waiting for an `Action` with a separate SDK
call does not seem very natural to me. Does the SDK-user need to know
that you are processing operations asynchronous? (Which seems like an
implementation detail to me, something that the SDK could abstrct over.)
Can `Client.Zone.Create()` return the final `Zone` instead of the
intermediate result?
- Features missing compared to the DNS Console, in priority order:
- It is no longer possible to remove your provided name servers from the
root/apex. Use-case: dual-home/multi-home zone with fewer than three
servers from Hetzner. I'm operating one of these and cannot migrate over
until this is fixed.
- Performance regression due to lack of bulk create/modify. E.g. [one of
the test
suites](a71b89e5a2/integrationTest/integration_test.go (L619))
spends about 4.5 minutes on making creating 100 record-sets and then
another 4 minutes for deleting them in sequence again. With your async
API, these are `create 2*100 + delete 2*100 = 400` API calls.
Previously, these were `create 1 + delete 100 = 101` API calls. Are you
planning on adding batch processing again?
- Usability nits
- Compared to other record-set based APIs, upserts for record-sets are
missing. This applies to records of a record-set and the ttl of the
record-set (see separate SDK calls for the cases `diff2.CREATE` vs
`diff2.CHANGE` and two calls in `diff2.CHANGE` for updating the TTL vs
records).
- Some SDK methods return an `Action` (e.g. `Zone.ChangeRRSetTTL()`),
others wrap the `Action` in a struct (`Client.Zone.CreateRRSet()`) --
even when the struct has a single field (`ZoneRRSetDeleteResult`).

---------

Co-authored-by: "Jonas L." <jooola@users.noreply.github.com>
Co-authored-by: "Lukas Kämmerling" <LKaemmerling@users.noreply.github.com>
Co-authored-by: Tom Limoncelli <6293917+tlimoncelli@users.noreply.github.com>
2025-11-30 09:14:54 -05:00
Gabe Van Engel
97209bc2fc
AKAMAIEDGEDNS: Add ALIAS and AKAMAITLC support to the Akamai Edge DNS provider (#3836) 2025-11-14 09:48:42 -05:00
Elvis Ratzlaff
2a4e2509bc
POWERDNS: New record type: LUA (#3815) 2025-11-03 11:32:28 -05:00
Jan von Aschwege
a71b89e5a2
NEW FEATURE: Add SMIMEA support for BIND and deSEC (#3786) 2025-10-10 11:16:13 -04:00
Georg
8c8948e69a
NEW RECORD TYPE: OPENPGPKEY (basic) (#3718)
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2025-08-11 10:44:12 -04:00
Alex Trull
ca64774004
Joker: Implement DNS Provider (#3661)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2025-08-04 16:37:20 -04:00
Ishan Jain
58afc59440
ADGUARDHOME: updated documentation with links to AGH pages (#3672) 2025-07-21 09:25:59 -04:00
Costas Drogos
c842eb26a5
NEW FEATURE: DKIM_BUILDER() adds a DKIM record builder (#3627)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2025-07-18 10:38:50 -04:00
Tom Limoncelli
a0d04a181a
CHORE: Remove "get-certs" command (#3657) 2025-07-09 14:01:23 -04:00
Tom Limoncelli
50e4bfb4e0 Revert "Remove docs"
This reverts commit 81a916cd5c.
2025-07-09 13:07:31 -04:00
Tom Limoncelli
8a6baa7c24 Reapply "CHORE: Remove the MSDNS provider (#3656)"
This reverts commit e9f136036f.
2025-07-09 13:07:03 -04:00
Tom Limoncelli
e9f136036f Revert "CHORE: Remove the MSDNS provider (#3656)"
This reverts commit 1ccd5eb532.
2025-07-09 13:06:42 -04:00
Tom Limoncelli
81a916cd5c Remove docs 2025-07-09 12:58:54 -04:00
Tom Limoncelli
1ccd5eb532
CHORE: Remove the MSDNS provider (#3656) 2025-07-09 12:47:48 -04:00
Ishan Jain
e1830abb58
NEW PROVIDER: ADGUARDHOME (#3638) 2025-07-09 12:06:34 -04:00
Klett IT
3bdbb48164
NEW PROVIDE: FORTIGATE (#3642) 2025-07-08 08:37:19 -04:00
Jeffrey Cafferata
0a4162f14a
DOCS: How to add a requested provider (#3636) 2025-06-23 15:48:00 -04:00
Jeffrey Cafferata
e5f4d97950
DOCS: [GitBook] Refactor structure to match URL paths and fix missing page links (#3613) 2025-06-11 16:20:23 -04:00
Jonathan Beliën
5c6325004d
Add some documentation 2025-05-18 22:47:50 +02:00
Costas Drogos
4f5655e510
NS1: remove deprecated NS1_URLFWD (#3400)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2025-01-27 10:29:26 -05:00
Asif Nawaz
a3d6c51c7f
CNR: Add support for ALIAS record type (#3360) 2025-01-14 16:46:55 -05:00
Jeffrey Cafferata
519e4f82e1
DOCS: Provider URI redirect (#3307)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2025-01-06 09:53:49 -05:00
Tom Limoncelli
1a1e592a5d
DOC: NEW: How to test a branch (#3264)
Co-authored-by: Jeffrey Cafferata <jeffrey@jcid.nl>
2024-12-19 13:18:58 -05:00
Tom Limoncelli
0b85cf2fe2
CNR Provider: Review CI / Docs / Capabilities (add NAPTR, SSHFP) (#3241)
Co-authored-by: Kai Schwarz <kai.schwarz@centralnic.com>
Co-authored-by: AsifNawaz-cnic <asif.nawaz@centralnic.com>
2024-12-12 19:43:17 -05:00
Tom Limoncelli
1872b12116
NEW FEATURE: IMPORT_TRANSFORM_STRIP (#3181) 2024-10-31 11:05:56 -04:00
fuero
94a0cfcba3
New Feature: HASH() adds hashing functions to dnsconfig.js language (#3085)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2024-08-21 09:21:39 -04:00
Takashi Takizawa
864d45290f
NEW PROVIDER: Sakura Cloud (SAKURACLOUD) (#3086)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2024-08-21 09:14:56 -04:00
Jeffrey Cafferata
7b286091d5
DOCS: CLOUDFLAREAPI - CF_SINGLE_REDIRECT (#3038) 2024-07-08 16:35:35 -04:00
Tom Limoncelli
088306883d
CLOUDFLAREAPI: Add CF_SINGLE_REDIRECT to manage "dynamic single" redirects (#3035) 2024-07-08 12:38:38 -04:00
Hui Hui
ce07c76fe8
Add support for huaweicloud dns (#3010)
Signed-off-by: huihuimoe <github@huihui.contact>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2024-06-17 12:04:32 -04:00
Tom Limoncelli
1fa92de07e
CHORE: Linting and comment-fixing (#2937) 2024-05-07 14:47:28 -04:00
Florian Ritterhoff
3a9b413175
NEW RECORD TYPE: HTTPS & SVCB (#2919)
Thanks so much for this contribution!  I have a feeling that a lot of people are going to need these records soon!
2024-05-01 11:37:15 -04:00
xtex
3f05482e6b
NEW RECORD TYPE: DNSKEY (#2917)
Signed-off-by: xtex <xtexchooser@duck.com>
2024-04-22 09:54:12 -04:00
Jeffrey Cafferata
5078927e01
DOCS: Simplified the provider URLs (providers) (#2914) 2024-04-18 09:43:50 -04:00
Jeffrey Cafferata
c31064781f
DOCS: Documentation directory structure (#2905) 2024-04-09 14:26:45 -04:00
Tom Limoncelli
1d96981e11
NEW FEATURE: Add RFC4183 support to REV() (#2879)
Co-authored-by: Thomas Misilo <tmisilo@ksu.edu>
Co-authored-by: Jeffrey Cafferata <jeffrey@jcid.nl>
2024-04-03 16:01:55 -04:00
imlonghao
42125b5248
NEW RECORD TYPE: DNAME (#2893) 2024-04-02 14:28:57 -04:00
Tom Limoncelli
1ae265e5f6
Add documentation for preview/push (#2884) 2024-03-27 13:57:21 -04:00
Jeffrey Cafferata
1106e44620
DOCS: Bunny DNS - GitBook escape the underscore (#2771)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2024-01-09 10:54:05 -05:00
PJEilers
3d570ead31
NEW DNS PROVIDER: Realtime Register (REALTIMEREGISTER) (#2741)
Co-authored-by: pieterjan.eilers <pieterjan.eilers@realtimeregister.com>
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2024-01-09 10:45:59 -05:00
Pascal Mathis
961eaa7862
NEW PROVIDER: Bunny DNS (#2265) (#2760) 2024-01-06 09:19:40 -05:00
evan
afd0d76e7b
NEW REGISTRAR: Dynadot (DYNADOT) (#2753)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2024-01-02 16:40:40 -05:00
Florian Ritterhoff
a5a1facdaf
DOCS: add dhcid RR docs (#2715) 2023-12-11 07:25:27 -05:00
Jeffrey Cafferata
c1f5a8c418
DOCS: Added the missing provider Exoscale page (#2664) 2023-12-04 10:30:30 -05:00
Jeffrey Cafferata
609de61669
DOCS: Added the missing provider OpenSRS page (#2665) 2023-12-04 10:04:55 -05:00