Commit graph

206 commits

Author SHA1 Message Date
Thomas Limoncelli
b0a909b853
Remove FakeDC hack. Replace with DC Name Varieties 2025-12-04 12:10:04 -05:00
Thomas Limoncelli
60f2595a60
cleanups 2025-12-04 11:29:16 -05:00
Thomas Limoncelli
4a9233d0b6
fix .NameFQDN* and other nits 2025-12-03 21:46:00 -05:00
Thomas Limoncelli
691764ee29
Merge branch 'main' into branch_allrecs 2025-12-03 20:42:10 -05:00
Tom Limoncelli
c11a523982
FEATURE: Fixing IDN support for domains (#3879)
# Issue

The previous fix had backwards compatibility issues and treated
uppercase Unicode incorrectly.

# Resolution

* Don't call strings.ToUpper() on Unicode strings. Only call it on the
output of ToASCII.
* Fix BIND's "filenameformat" to be more compatible (only breaks if you
had uppercase unicode in a domain name... which you probably didn't)
* Change IDN to ASCII in most places (Thanks for the suggestion,
@KaiSchwarz-cnic!)
* Update BIND documentation
2025-12-03 20:31:59 -05:00
Tom Limoncelli
e87f03a8a3
CHORE: fmt (#3882) 2025-12-03 14:53:02 -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
Thomas Limoncelli
e42dbcda57
Merge branch 'main' into branch_allrecs 2025-12-01 11:07:45 -05:00
Kevin Ji
ec9a9e23af
CLOUDFLARE: Add LOC support (#3857)
Fixes #2798.

I tested this locally and it seems to update the `LOC` record correctly.
2025-12-01 09:12:10 -05:00
Thomas Limoncelli
a3ed1dc6b2
wip! getting BIND to work 2025-11-30 11:46:27 -05:00
Thomas Limoncelli
1efa022349
wip! 2025-11-30 10:50:18 -05:00
Thomas Limoncelli
a5a624ff96
Clean up cfsingleredirect 2025-11-30 09:28:24 -05:00
Tom Limoncelli
1b2f5d4d34
BUGFIX: IDN support is broken for domain names (#3845)
# Issue

Fixes https://github.com/StackExchange/dnscontrol/issues/3842

CC @das7pad

# Resolution

Convert domain.Name to IDN earlier in the pipeline. Hack the --domains
processing to convert everything to IDN.

* Domain names are now stored 3 ways: The original input from
dnsconfig.js, canonical IDN format (`xn--...`), and Unicode format. All
are downcased. Providers that haven't been updated will receive the IDN
format instead of the original input format. This might break some
providers but only for users with unicode in their D("domain.tld").
PLEASE TEST YOUR PROVIDER.
* BIND filename formatting options have been added to access the new
formats.

# Breaking changes

* BIND zonefiles may change. The default used the name input in the D()
statement. It now defaults to the IDN name + "!tag" if there is a tag.
* Providers that are not IDN-aware may break (hopefully only if they
weren't processing IDN already)

---------

Co-authored-by: Jakob Ackermann <das7pad@outlook.com>
2025-11-29 12:17:44 -05:00
Thomas Limoncelli
4b68c79d4f
fixing tests 2025-11-26 23:13:39 -05:00
Thomas Limoncelli
98f4075bd7
cf redirects work, but wrong order 2025-11-26 21:25:25 -05:00
Thomas Limoncelli
acc6d362d0
wip! 2025-11-25 17:54:30 -05:00
Thomas Limoncelli
a95edcaa58
Merge branch 'tlim_b3842_idn' into branch_allrecs 2025-11-25 13:17:07 -05:00
Thomas Limoncelli
a0ec11ee60
Fix BIND 2025-11-25 11:28:41 -05:00
Thomas Limoncelli
14c98cdda1
cleanups 2025-11-24 20:53:19 -05:00
Thomas Limoncelli
cc8884824d
permit works 2025-11-24 20:25:38 -05:00
Thomas Limoncelli
c2a64002fe
refactor(idn) IDN now works at the domain (not just label) level 2025-11-24 20:25:38 -05:00
Thomas Limoncelli
d0604a24d1
m 2025-11-24 20:25:38 -05:00
Thomas Limoncelli
4b7da682a4
wip! 2025-11-24 13:24:51 -05:00
Thomas Limoncelli
633c9ecacc
m 2025-11-24 09:38:18 -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
Tom Limoncelli
3eddfcd037
feat(validation): Validation errors now include the line number (#3788) 2025-10-10 13:48:41 -04:00
Jan von Aschwege
a71b89e5a2
NEW FEATURE: Add SMIMEA support for BIND and deSEC (#3786) 2025-10-10 11:16:13 -04:00
Paul Sütterlin
589cb77c68
CAA: Support issuemail / issuevmc tag in CAA builder (#3774)
Co-authored-by: Paul Sütterlin <psuet@kawo1.rwth-aachen.de>
2025-09-22 16:12:30 -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
Ishan Jain
e1830abb58
NEW PROVIDER: ADGUARDHOME (#3638) 2025-07-09 12:06:34 -04:00
Max Chernoff
3ea7ea84c9
FEATURE: Support ignoring the ech= parameter in HTTPS/SVCB RR types (#3485) 2025-06-11 11:16:15 -04:00
Vatsalya Goel
697433563f
AZURE_DNS: Dedupe nameserver (#3526)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2025-05-03 08:36:31 -04:00
Tom Limoncelli
475f99b8d5
bug(rev) D_EXTEND does not work with REV (#3488) 2025-03-21 12:39:23 -04:00
Tom Limoncelli
5ad2df1076
BUG: fix panic message (#3489) 2025-03-10 19:39:20 -04:00
Steven Rombauts
063d8b06e8
BUNNY_DNS: Add support for Redirect record (#3472) 2025-03-07 09:07:25 -05:00
Eli Heady
48c99f7065
Improve tagged domain handling in support of Split Horizon feature (#3444)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2025-02-25 12:27:24 -05:00
Tom Limoncelli
3f8f9e7818
refactor(RecordConfig): Use ChangeType() instead of assignment (#3441) 2025-02-18 14:01:34 -05: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
Jakob Ackermann
556926a2f7
BUG: Create zones ahead of gathering data (#3337)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2025-01-14 17:02:05 -05:00
Tom Limoncelli
5dbe5e84c9
CHORE: Fix lint warnings from golangci-lint (#3311) 2025-01-13 11:33:12 -05:00
Paul Donald
d6d50fc862
LOC: fix float altitude value ingestion, gate size and precision values (#3130)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2024-09-27 12:06:19 -04:00
Tom Limoncelli
06ba3cce77
Bugfix: Providers with batched updates might not report the correct number of changes (#3108) 2024-09-16 12:20:30 -04:00
imlonghao
04f34cf2e3
PORKBUN: support URL Forward (#3064)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2024-08-26 14:50:25 -04:00
Tom Limoncelli
0869052419
CLOUDFLAREAPI: CF_SINGLE_REDIRECT improvements: fix bugs, log translated redirects (#3051) 2024-07-18 12:10:46 -04:00
Tom Limoncelli
95c7a70434
REFACTOR: Pave args (not validate) (#3045) 2024-07-09 21:44:38 -04:00
Tom Limoncelli
088306883d
CLOUDFLAREAPI: Add CF_SINGLE_REDIRECT to manage "dynamic single" redirects (#3035) 2024-07-08 12:38:38 -04:00
Tom Limoncelli
7fd6a74e0c
CLOUDFLAREAPI: CF_REDIRECT/CF_TEMP_REDIRECT should dtrt using Single Redirects (#3002)
Co-authored-by: Josh Zhang <jzhang1@stackoverflow.com>
2024-06-18 17:38:50 -04:00
Tom Limoncelli
0a784a3803
CHORE: Clean up comments in models/domain.go (#2975) 2024-05-22 16:04:41 -04:00
Jérôme Foray
c67962309e
DESEC: Enable support for SVCB/HTTPS (#2942)
Signed-off-by: Jérôme foray <moi@foray-jero.me>
2024-05-08 09:39:18 -04:00