Commit c93f116
authored
GIDINET: Auto-suggest nameservers and add premium DNS helper (#4203)
## Summary
- **`GetNameservers` now returns the static free-tier Gidinet
nameservers** (`dnsl1/dnsl2.gidinet.com`). Previously it returned `nil,
nil`, which meant DNSControl could not derive registrar delegation from
the DNS provider for Gidinet-hosted zones. With this change, zones
declared as `D(..., REG_GIDINET, DnsProvider(DSP_GIDINET), ...)` get
correct NS suggestions automatically, matching the behavior of providers
like Cloudflare or netcup.
- **New `GIDINET_PREMIUM_NS()` JS helper** that emits
`NAMESERVER("dns1..dns5.gidinet.com.")` for zones on Gidinet's premium
DNS tier. Intended to be paired with `DnsProvider(DSP_GIDINET, 0)` so
the free-tier defaults from `GetNameservers` are skipped and only the
five premium nameservers drive the delegation.
- **`filterApexNS` now drops apex NS records silently when they were
synthesized from `dc.Nameservers`** (either auto-injected by
`GetNameservers` or declared via `NAMESERVER()`), since `AddNSRecords`
adds those to `dc.Records` automatically. Previously it warned on every
preview once `GetNameservers` began returning values. Truly unexpected
apex NS targets (e.g. a stray `NS("@", "something-else.")`) still emit a
warning because the Gidinet DNS API cannot honor them.
- **Documentation updated** to describe both tiers and the
`GIDINET_PREMIUM_NS()` usage pattern.
## Motivation
Before this change, a zone served by Gidinet DNS required a redundant
`NS_GIDINET()`-style block of explicit `NAMESERVER()` calls just so
`REG_GIDINET` could propose the correct delegation. Users hit a
no-op/warning loop where the registrar had nothing to compare against
and/or where apex NS records raised spurious warnings. Gidinet's
nameservers are static per-tier, so returning them from `GetNameservers`
is safe and matches the convention used by other providers.
## Test plan
- [x] `go test ./...`
- [x] `go vet ./...`
- [x] `gofmt -l providers/gidinet/ pkg/js/`
- [x] `dnscontrol check` on a real Gidinet-hosted configuration
- [x] `dnscontrol preview` on a free-tier zone: registrar correctly
proposes `dnsl1/dnsl2.gidinet.com` delegation without explicit
`NAMESERVER()` in the zone file; no spurious apex-NS warnings.
- [ ] `dnscontrol preview` on a premium-tier zone using
`DnsProvider(DSP_GIDINET, 0) + GIDINET_PREMIUM_NS()` (pending
availability of a premium zone for the author to validate end-to-end).
- [x] IR inspection (`print-ir`) on a synthetic premium-tier config
confirms the helper expands to the five
`NAMESERVER("dns1..5.gidinet.com.")` entries.
## Notes
- No interface or API changes.
- Backwards compatible: zones that already include explicit
`NAMESERVER("dnsl1/dnsl2…")` records still work (the registrar-side
dedup already handles duplicates).1 parent b55ad79 commit c93f116
3 files changed
Lines changed: 74 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
130 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
131 | 138 | | |
132 | | - | |
| 139 | + | |
133 | 140 | | |
134 | 141 | | |
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
138 | 145 | | |
139 | 146 | | |
140 | | - | |
141 | | - | |
142 | 147 | | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
147 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
148 | 172 | | |
149 | 173 | | |
150 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1490 | 1490 | | |
1491 | 1491 | | |
1492 | 1492 | | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
1493 | 1515 | | |
1494 | 1516 | | |
1495 | 1517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
103 | 104 | | |
104 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
338 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
339 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
340 | 353 | | |
341 | 354 | | |
342 | 355 | | |
343 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
344 | 360 | | |
345 | 361 | | |
346 | 362 | | |
| |||
0 commit comments