You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUGFIX: IDN support is broken for domain names (#3845)
# Issue
Fixes#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 <[email protected]>
Copy file name to clipboardExpand all lines: documentation/provider/bind.md
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,8 @@ Example:
22
22
{
23
23
"bind": {
24
24
"TYPE": "BIND",
25
-
"directory": "myzones"
25
+
"directory": "myzones",
26
+
"filenameformat": "%U.zone"
26
27
}
27
28
}
28
29
```
@@ -89,10 +90,13 @@ file name is the name as specified in the `D()` function plus ".zone".
89
90
90
91
The filenameformat is a string with a few printf-like `%` verbs:
91
92
92
-
*`%U` the domain name as specified in `D()`
93
-
*`%D` the domain name without any split horizon tag (the "example.com" part of "example.com!tag")
94
-
*`%T` the split horizon tag, or "" (the "tag" part of "example.com!tag")
95
-
*`%?x` this returns `x` if the split horizon tag is non-null, otherwise nothing. `x` can be any printable.
93
+
* The domain name without tag (the `example.com` part of `example.com!tag`):
94
+
*`%D` as specified in `D()` (no IDN conversion, but downcased)
95
+
*`%I` converted to IDN/Punycode (`xn--...`) and downcased.
96
+
*`%N` converted to Unicode (downcased first)
97
+
*`%T` the split horizon tag, or "" (the `tag` part of `example.com!tag`)
98
+
*`%?x` this returns `x` if the split horizon tag is non-null, otherwise nothing. `x` can be any printable but is usually `!`.
99
+
*`%U` short for "%I%?!%T". This is the universal, canonical, name for the domain used for comparisons within DNSControl. This is best for filenames which is why it is used in the default.
96
100
*`%%``%`
97
101
* ordinary characters (not `%`) are copied unchanged to the output stream
98
102
* FYI: format strings must not end with an incomplete `%` or `%?`
@@ -101,19 +105,17 @@ Typical values:
101
105
102
106
*`%U.zone` (The default)
103
107
*`example.com.zone` or `example.com!tag.zone`
104
-
*`%T%*U%D.zone` (optional tag and `_` + domain + `.zone`)
108
+
*`%T%?_%I.zone` (optional tag and `_` + domain + `.zone`)
105
109
*`tag_example.com.zone` or `example.com.zone`
106
110
*`db_%T%?_%D`
107
111
*`db_inside_example.com` or `db_example.com`
108
-
*`db_%D`
109
-
*`db_example.com`
110
-
111
-
The last example will generate the same name for both
112
-
`D("example.com!inside")` and `D("example.com!outside")`. This
113
-
assumes two BIND providers are configured in `creds.json`, each with
114
-
a different `directory` setting. Otherwise `dnscontrol` will write
115
-
both domains to the same file, flapping between the two back and
116
-
forth.
112
+
113
+
{% hint style="warning" %}
114
+
**Warning** DNSControl will not warn you if two zones generate the same
115
+
filename. Instead, each will write to the same place. The content would end up
116
+
flapping back and forth between the two. The best way to prevent this is to
117
+
always include the tag (`%T`) or use `%U` which includes the tag.
118
+
{% endhint %}
117
119
118
120
(new in v4.2.0) `dnscontrol push` will create subdirectories along the path to
119
121
the filename. This includes both the portion of the path created by the
0 commit comments