-
-
Notifications
You must be signed in to change notification settings - Fork 240
Open
Description
Hi, and thanks for GoDNS – it’s been rock-solid for keeping a bunch of Cloudflare A records in sync with my public IP 👋
I’ve hit a limitation with how the reconciliation loop currently works:
- I manage a relatively large number of subdomains on a single zone (dozens of A records).
- GoDNS does exactly what I expect for create and update:
- If a subdomain in
domains[].sub_domainshas no DNS record → it gets created. - If the DNS record exists but the IP has changed → it gets updated.
- If a subdomain in
- However, if I remove a subdomain from
sub_domainsinconfig.json, the corresponding DNS record is left behind at the provider (Cloudflare in my case) and is never touched again.
Over time this leads to drift:
- The config file becomes the “desired state”.
- The DNS zone accumulates stale/unused records that are no longer referenced anywhere in the config.
- There’s no way to “garbage collect” DNS records that are not part of the desired state anymore.
Feature proposal
Introduce an optional “config as source of truth” mode where GoDNS:
- Treats
config.jsonas the desired state for the managed domain(s). - On each reconciliation loop:
- Lists existing DNS records for the configured domain(s) (A/AAAA only, or configurable).
- Compares them against
domains[].sub_domains. - Deletes records that:
- belong to a managed domain,
- are of a managed type (A and/or AAAA),
- and are not present in the current
sub_domainslist.
Something like:
{
"provider": "Cloudflare",
"login_token": "…",
"domains": [
{
"domain_name": "example.com",
"sub_domains": ["app", "api", "vpn"]
}
],
"cleanup_unknown_records": true
}Metadata
Metadata
Assignees
Labels
No labels