Skip to content

Commit 1e599ca

Browse files
authored
BUG: Fix get-zones argument parsing to match documentation (#4240)
I ran into this same issue while working on #4208 and can confirm the behavior @stefanwascoding describes. The only form that works requires the provider name explicitly: ```shell dnscontrol get-zones transip TRANSIP all ``` ```text WARNING: To retain compatibility in future versions, please change "TRANSIP" to "-". See "https://docs.dnscontrol.org/commands/get-zones" ``` But following that suggestion also fails: ```shell dnscontrol get-zones transip - all ``` ```text Arguments should be: credskey providername zone(s) (Ex: r53 ROUTE53 example.com) ``` So neither the documented 2 argument form (`transip all`) nor the suggested dash form (`transip - all`) works. This pull request fixes the argument parsing so that `get-zones` accepts 2 arguments (`credkey zone`), resolving the provider type from the `TYPE` field in `creds.json`. The old 3 argument form still works but now shows a deprecation warning with the correct command: ```shell dnscontrol get-zones transip TRANSIP all ``` ```text WARNING: The provider name argument is deprecated. Please use "dnscontrol get-zones transip all" instead. See "https://docs.dnscontrol.org/commands/get-zones" ``` With 3+ arguments, the code now detects whether the second argument is a registered provider type to distinguish the deprecated form (`credkey provider zone...`) from the new multi-zone form (`credkey zone1 zone2...`): ```shell dnscontrol get-zones --format=nameonly transip dnscontrol.org dnscontrol.nl ``` ```text dnscontrol.org dnscontrol.nl ``` Additionally: - CLI help is shortened and links to online documentation - Examples use descriptive `credkey` names (`my_route53` instead of `myr53`) so they are self-explanatory without the provider name - `Documentation:` links are added to `get-zones` and `check-creds` - `documentation/commands/get-zones.md` is updated to match Tested against the TransIP provider with the `dnscontrol.org` zone from #4204. - [x] `go test ./commands/` - [x] `dnscontrol get-zones transip all` (2 args, new style) - [x] `dnscontrol get-zones transip dnscontrol.org` (specific zone) - [x] `dnscontrol get-zones transip dnscontrol.org dnscontrol.nl` (multiple zones, new style) - [x] `dnscontrol get-zones transip TRANSIP all` (3 args, deprecation warning) - [x] `dnscontrol get-zones transip` (too few args, error message) - [x] `dnscontrol get-zones --format=zone transip dnscontrol.org` - [x] `dnscontrol get-zones --format=tsv transip dnscontrol.org` - [x] `dnscontrol get-zones --format=nameonly transip all` <details> <summary>CLI diff</summary> ```diff --- before (v4.37.1) +++ after @@ -2,7 +2,7 @@ dnscontrol get-zones - gets a zone from a provider (stand-alone) USAGE: - dnscontrol get-zones [command options] credkey provider zone [...] + dnscontrol get-zones [command options] credkey zone [...] CATEGORY: utility @@ -11,34 +11,18 @@ Download a zone from a provider. This is a stand-alone utility. ARGUMENTS: - credkey: The name used in creds.json (first parameter to NewDnsProvider() in dnsconfig.js) + credkey: The name used in creds.json - provider: The name of the provider (second parameter to NewDnsProvider() in dnsconfig.js) zone: One or more zones (domains) to download; or "all". - FORMATS: - --format=js dnsconfig.js format (not perfect, just a decent first draft) - --format=djs js with disco commas (leading commas) - --format=zone BIND zonefile format - --format=tsv TAB separated value (useful for AWK) - --format=nameonly Just print the zone names - - The columns in --format=tsv are: - FQDN (the label with the domain) - ShortName (just the label, "@" if it is the naked domain) - TTL - Record Type (A, AAAA, CNAME, etc.) - Target and arguments (quoted like in a zonefile) - Either empty or a comma-separated list of properties like "cloudflare_proxy=true" - - The --ttl flag only applies to zone/js/djs formats. - EXAMPLES: - dnscontrol get-zones myr53 ROUTE53 example.com - dnscontrol get-zones gmain GANDI_V5 example.com other.com - dnscontrol get-zones cfmain CLOUDFLAREAPI all - dnscontrol get-zones --format=tsv bind BIND example.com - dnscontrol get-zones --format=djs --out=draft.js gcloud GCLOUD example.com + dnscontrol get-zones my_route53 example.com + dnscontrol get-zones my_gandi example.com other.com + dnscontrol get-zones my_cloudflare all + dnscontrol get-zones --format=tsv my_bind example.com + dnscontrol get-zones --format=djs --out=draft.js my_gcloud example.com + Documentation: https://docs.dnscontrol.org/commands/get-zones + OPTIONS: --creds string Provider credentials JSON file (or !program to execute program that outputs json) (default: "creds.json") --format string Output format: js djs zone tsv nameonly (default: "zone") ``` </details> Fixes #4235
1 parent c93f116 commit 1e599ca

9 files changed

Lines changed: 55 additions & 415 deletions

File tree

commands/getZones.go

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,57 +24,52 @@ var _ = cmd(catUtils, func() *cli.Command {
2424
Aliases: []string{"get-zone"},
2525
Usage: "gets a zone from a provider (stand-alone)",
2626
Action: func(ctx context.Context, c *cli.Command) error {
27-
if c.NArg() < 3 {
28-
return cli.Exit("Arguments should be: credskey providername zone(s) (Ex: r53 ROUTE53 example.com)", 1)
27+
if c.NArg() < 2 {
28+
return cli.Exit("Arguments should be: credskey zone(s) (Ex: my_cloudflare example.com)", 1)
2929
}
3030
args.CredName = c.Args().Get(0)
31-
arg1 := c.Args().Get(1)
32-
args.ProviderName = arg1
33-
// In v4.0, skip the first args.ZoneNames if it equals "-".
34-
args.ZoneNames = c.Args().Slice()[2:]
35-
36-
if arg1 != "" && arg1 != "-" {
37-
// NB(tlim): In v4.0 this "if" can be removed.
38-
fmt.Fprintf(os.Stderr, "WARNING: To retain compatibility in future versions, please change %q to %q. See %q\n",
39-
arg1, "-",
40-
"https://docs.dnscontrol.org/commands/get-zones",
41-
)
31+
if c.NArg() == 2 || c.Args().Get(1) == "-" {
32+
args.ProviderName = ""
33+
if c.Args().Get(1) == "-" {
34+
args.ZoneNames = c.Args().Slice()[2:]
35+
} else {
36+
args.ZoneNames = c.Args().Slice()[1:]
37+
}
38+
} else {
39+
arg1 := c.Args().Get(1)
40+
if _, ok := providers.DNSProviderTypes[arg1]; ok {
41+
// Deprecated form: credkey provider zone [...]
42+
args.ProviderName = arg1
43+
args.ZoneNames = c.Args().Slice()[2:]
44+
fmt.Fprintf(os.Stderr, "WARNING: The provider name argument is deprecated. Please use \"dnscontrol get-zones %s %s\" instead. See %q\n",
45+
args.CredName, strings.Join(args.ZoneNames, " "),
46+
"https://docs.dnscontrol.org/commands/get-zones",
47+
)
48+
} else {
49+
// New form with multiple zones: credkey zone1 zone2 [...]
50+
args.ProviderName = ""
51+
args.ZoneNames = c.Args().Slice()[1:]
52+
}
4253
}
4354

4455
return exit(GetZone(args))
4556
},
4657
Flags: args.flags(),
47-
UsageText: "dnscontrol get-zones [command options] credkey provider zone [...]",
58+
UsageText: "dnscontrol get-zones [command options] credkey zone [...]",
4859
Description: `Download a zone from a provider. This is a stand-alone utility.
4960
5061
ARGUMENTS:
51-
credkey: The name used in creds.json (first parameter to NewDnsProvider() in dnsconfig.js)
52-
provider: The name of the provider (second parameter to NewDnsProvider() in dnsconfig.js)
62+
credkey: The name used in creds.json
5363
zone: One or more zones (domains) to download; or "all".
5464
55-
FORMATS:
56-
--format=js dnsconfig.js format (not perfect, just a decent first draft)
57-
--format=djs js with disco commas (leading commas)
58-
--format=zone BIND zonefile format
59-
--format=tsv TAB separated value (useful for AWK)
60-
--format=nameonly Just print the zone names
61-
62-
The columns in --format=tsv are:
63-
FQDN (the label with the domain)
64-
ShortName (just the label, "@" if it is the naked domain)
65-
TTL
66-
Record Type (A, AAAA, CNAME, etc.)
67-
Target and arguments (quoted like in a zonefile)
68-
Either empty or a comma-separated list of properties like "cloudflare_proxy=true"
69-
70-
The --ttl flag only applies to zone/js/djs formats.
71-
7265
EXAMPLES:
73-
dnscontrol get-zones myr53 ROUTE53 example.com
74-
dnscontrol get-zones gmain GANDI_V5 example.com other.com
75-
dnscontrol get-zones cfmain CLOUDFLAREAPI all
76-
dnscontrol get-zones --format=tsv bind BIND example.com
77-
dnscontrol get-zones --format=djs --out=draft.js gcloud GCLOUD example.com`,
66+
dnscontrol get-zones my_route53 example.com
67+
dnscontrol get-zones my_gandi example.com other.com
68+
dnscontrol get-zones my_cloudflare all
69+
dnscontrol get-zones --format=tsv my_bind example.com
70+
dnscontrol get-zones --format=djs --out=draft.js my_gcloud example.com
71+
72+
Documentation: https://docs.dnscontrol.org/commands/get-zones`,
7873
}
7974
}())
8075

@@ -120,7 +115,9 @@ ARGUMENTS:
120115
EXAMPLES:
121116
dnscontrol check-creds myr53 ROUTE53 # Pre v3.16, or pre-v4.0 for backwards-compatibility
122117
dnscontrol check-creds myr53
123-
dnscontrol check-creds --out=/dev/null myr53 && echo Success`,
118+
dnscontrol check-creds --out=/dev/null myr53 && echo Success
119+
120+
Documentation: https://docs.dnscontrol.org/commands/check-creds`,
124121
}
125122
}())
126123

commands/types/dnscontrol.d.ts

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2783,26 +2783,11 @@ declare function NS(name: string, target: string, ...modifiers: RecordModifier[]
27832783
* answers on port 53 to queries related to the zone).
27842784
*
27852785
* * `name` must match the name of an entry in `creds.json`.
2786-
* * `type` specifies a valid DNS provider type identifier listed on the [provider page](../../provider/index.md).
2787-
* * Starting with [v3.16](../../release/v316.md), the type is optional. If it is absent, the `TYPE` field in `creds.json` is used instead. You can leave it out. (Thanks to JavaScript magic, you can leave it out even when there are more fields).
2788-
* * Starting with v4.0, specifying the type may be an error. Please add the `TYPE` field to `creds.json` and remove this parameter from `dnsconfig.js` to prepare.
2786+
* * `type` is deprecated. The provider type is read from the `TYPE` field in `creds.json`.
27892787
* * `meta` is a way to send additional parameters to the provider. It is optional and only certain providers use it. See the [individual provider docs](../../provider/index.md) for details.
27902788
*
27912789
* This function will return an opaque string that should be assigned to a variable name for use in [D](D.md) directives.
27922790
*
2793-
* Prior to [v3.16](../../release/v316.md):
2794-
*
2795-
* ```javascript
2796-
* var REG_MYNDC = NewRegistrar("mynamedotcom", "NAMEDOTCOM");
2797-
* var DNS_MYAWS = NewDnsProvider("myaws", "ROUTE53");
2798-
*
2799-
* D("example.com", REG_MYNDC, DnsProvider(DNS_MYAWS),
2800-
* A("@","1.2.3.4"),
2801-
* );
2802-
* ```
2803-
*
2804-
* In [v3.16](../../release/v316.md) and later:
2805-
*
28062791
* ```javascript
28072792
* var REG_MYNDC = NewRegistrar("mynamedotcom");
28082793
* var DNS_MYAWS = NewDnsProvider("myaws");
@@ -2822,26 +2807,11 @@ declare function NewDnsProvider(name: string, meta?: object): string;
28222807
* nameservers for the domain). DNSControl only manages the delegation.
28232808
*
28242809
* * `name` must match the name of an entry in `creds.json`.
2825-
* * `type` specifies a valid DNS provider type identifier listed on the [provider page](../../provider/index.md).
2826-
* * Starting with [v3.16](../../release/v316.md), the type is optional. If it is absent, the `TYPE` field in `creds.json` is used instead. You can leave it out. (Thanks to JavaScript magic, you can leave it out even when there are more fields).
2827-
* * Starting with v4.0, specifying the type may be an error. Please add the `TYPE` field to `creds.json` and remove this parameter from `dnsconfig.js` to prepare.
2810+
* * `type` is deprecated. The provider type is read from the `TYPE` field in `creds.json`.
28282811
* * `meta` is a way to send additional parameters to the provider. It is optional and only certain providers use it. See the [individual provider docs](../../provider/index.md) for details.
28292812
*
28302813
* This function will return an opaque string that should be assigned to a variable name for use in [D](D.md) directives.
28312814
*
2832-
* Prior to [v3.16](../../release/v316.md):
2833-
*
2834-
* ```javascript
2835-
* var REG_MYNDC = NewRegistrar("mynamedotcom", "NAMEDOTCOM");
2836-
* var DNS_MYAWS = NewDnsProvider("myaws", "ROUTE53");
2837-
*
2838-
* D("example.com", REG_MYNDC, DnsProvider(DNS_MYAWS),
2839-
* A("@","1.2.3.4"),
2840-
* );
2841-
* ```
2842-
*
2843-
* In [v3.16](../../release/v316.md) and later:
2844-
*
28452815
* ```javascript
28462816
* var REG_MYNDC = NewRegistrar("mynamedotcom");
28472817
* var DNS_MYAWS = NewDnsProvider("myaws");

documentation/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,4 @@
229229
## Release
230230

231231
* [How to build and ship a release](release/release-engineering.md)
232-
* [Changelog v3.16.0](release/v316.md)
233232
* [GitHub releases](https://github.com/DNSControl/dnscontrol/releases/latest)

documentation/commands/check-creds.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,21 @@ successful, a list of zones will be output (which may be an empty list). If the
88
```text
99
Syntax:
1010
11-
dnscontrol check-creds [command options] credkey provider
11+
dnscontrol check-creds [command options] credkey
1212
1313
--creds value Provider credentials JSON file (default: "creds.json")
1414
--out value Instead of stdout, write to this file
1515
1616
ARGUMENTS:
17-
credkey: The name used in creds.json (first parameter to NewDnsProvider() in dnsconfig.js)
18-
provider: The name of the provider (second parameter to NewDnsProvider() in dnsconfig.js)
17+
credkey: The name used in creds.json
1918
```
2019

21-
Starting in [v3.16](../release/v316.md), "provider" is optional. If it is omitted (or the placeholder value `-` is used), the `TYPE` specified in `creds.json` will be used instead. A warning will be displayed with advice on how to remain compatible with v4.0.
22-
23-
Starting in v4.0, the "provider" argument is expected to go away.
20+
The provider type is read from the `TYPE` field in `creds.json`.
2421

2522
## Examples
2623

2724
```shell
28-
dnscontrol check-creds myr53 ROUTE53
29-
```
30-
31-
Starting in [v3.16](../release/v316.md):
32-
33-
```shell
34-
dnscontrol check-creds myr53
35-
dnscontrol check-creds myr53 -
36-
dnscontrol check-creds myr53 ROUTE53
37-
```
38-
39-
Starting in v4.0:
40-
41-
```shell
42-
dnscontrol check-creds myr53
25+
dnscontrol check-creds my_route53
4326
```
4427

4528
This command is the same as `get-zones` with `--format=nameonly`

documentation/commands/creds-json.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,9 @@ Here's a sample file:
4242
* ...may include any JSON string value including the empty string.
4343
* If a subkey starts with `$`, it is taken as an env variable. In the above example, `$CNR_APILOGIN` would be replaced by the value of the environment variable `CNR_APILOGIN` or the empty string if no such environment variable exists.
4444

45-
## New in v3.16
45+
## The TYPE subkey
4646

47-
The special subkey "TYPE" is used to indicate the provider type (NONE, CLOUDFLAREAPI, GCLOUD, etc).
48-
49-
Prior to [v3.16](../release/v316.md), the provider type is specified as the second argument to `NewRegistrar()` and `NewDnsProvider()` in `dnsconfig.js` or as a command-line argument in tools such as `dnscontrol get-zones`.
50-
51-
Starting in [v3.16](../release/v316.md), `NewRegistrar()`, and `NewDnsProvider()` no longer require the provider type to be specified. It may be specified for backwards compatibility, but a warning will be generated with a suggestion of how to upgrade to the 4.0 format. Likewise, command-line tools no longer require the provider type to be specified, but for backwards compatibility one may specify `-` since the parameter is positional.
52-
53-
In 4.0, DNSControl will require the "TYPE" subkey in each `creds.json` entry. Command line tools will have a backwards-incompatible change to remove the provider-type as a positional argument. Prior to 4.0, the various commands will output warnings and suggestions to avoid compatibility issues during the transition.
47+
The special subkey "TYPE" is required in each `creds.json` entry. It indicates the provider type (NONE, CLOUDFLAREAPI, GCLOUD, etc).
5448

5549
## Error messages
5650

@@ -114,11 +108,7 @@ Examples:
114108
```
115109
{% endcode %}
116110

117-
Starting with [v3.16](../release/v316.md) use of an OLD format will trigger warnings with suggestions on how to adopt the NEW format.
118-
119-
Starting with v4.0 support for the OLD format may be reported as an error.
120-
121-
Please adopt the NEW format when your installation has eliminated any use of DNSControl pre-3.16.
111+
Use of the OLD format will trigger warnings with suggestions on how to adopt the NEW format.
122112

123113
### mismatch
124114

documentation/commands/get-zones.md

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ If a provider supports it, `--format=nameonly` lists the names of the zones at t
3333
## Syntax
3434

3535
```shell
36-
dnscontrol get-zones [command options] credkey provider zone [...]
36+
dnscontrol get-zones [command options] credkey zone [...]
3737

3838
--creds value Provider credentials JSON file (default: "creds.json")
3939
--format value Output format: js djs zone tsv nameonly (default: "zone")
@@ -42,13 +42,10 @@ dnscontrol get-zones [command options] credkey provider zone [...]
4242
4343
ARGUMENTS:
4444
credkey: The name used in creds.json (first parameter to NewDnsProvider() in dnsconfig.js)
45-
provider: The name of the provider (second parameter to NewDnsProvider() in dnsconfig.js)
4645
zone: One or more zones (domains) to download; or "all".
4746
```
4847
49-
As of [v3.16](../release/v316.md), `provider` can be `-` to indicate that the provider name is listed in `creds.json` in the `TYPE` field. Doing this will be backwards compatible with an (otherwise) breaking change due in v4.0.
50-
51-
As of v4.0 (BREAKING CHANGE), you must not specify `provider`. That value is found in the `TYPE` field of the credkey's `creds.json` file. For backwards compatibility, if the first `zone` is `-`, it will be skipped.
48+
The provider type is read from the `TYPE` field in `creds.json`. For backwards compatibility, you may still specify the provider name explicitly as a second argument (e.g. `dnscontrol get-zones my_route53 ROUTE53 example.com`), but this is deprecated.
5249
5350
```shell
5451
FORMATS:
@@ -73,50 +70,17 @@ The `--ttl` flag only applies to zone/js/djs formats.
7370
## Examples
7471
7572
```shell
76-
dnscontrol get-zones myr53 ROUTE53 example.com
77-
dnscontrol get-zones gmain GANDI_V5 example.comn other.com
78-
dnscontrol get-zones cfmain CLOUDFLAREAPI all
79-
dnscontrol get-zones --format=tsv bind BIND example.com
80-
dnscontrol get-zones --format=djs --out=draft.js glcoud GCLOUD example.com
81-
```
82-
83-
As of [v3.16](../release/v316.md):
84-
85-
```shell
86-
# NOTE: When "-" appears as the 2nd argument, it is assumed that the
87-
# creds.json entry has a field TYPE with the provider's type name.
88-
dnscontrol get-zones gmain GANDI_V5 example.comn other.com
89-
dnscontrol get-zones gmain - example.comn other.com
90-
dnscontrol get-zones cfmain CLOUDFLAREAPI all
91-
dnscontrol get-zones cfmain - all
92-
dnscontrol get-zones --format=tsv bind BIND example.com
93-
dnscontrol get-zones --format=tsv bind - example.com
94-
dnscontrol get-zones --format=djs --out=draft.js glcoud GCLOUD example.com
95-
dnscontrol get-zones --format=djs --out=draft.js glcoud - example.com
96-
```
97-
98-
As of v4.0:
99-
100-
```shell
101-
dnscontrol get-zones gmain example.comn other.com
102-
dnscontrol get-zones cfmain all
103-
dnscontrol get-zones --format=tsv bind example.com
104-
dnscontrol get-zones --format=djs --out=draft.js glcoud example.com
105-
```
106-
107-
For backwards compatibility, these are valid until at least v5.0
108-
109-
```shell
110-
dnscontrol get-zones gmain - example.comn other.com
111-
dnscontrol get-zones cfmain - all
112-
dnscontrol get-zones --format=tsv bind - example.com
113-
dnscontrol get-zones --format=djs --out=draft.js glcoud - example.com
73+
dnscontrol get-zones my_route53 example.com
74+
dnscontrol get-zones my_gandi example.com other.com
75+
dnscontrol get-zones my_cloudflare all
76+
dnscontrol get-zones --format=tsv my_bind example.com
77+
dnscontrol get-zones --format=djs --out=draft.js my_gcloud example.com
11478
```
11579
11680
Read a zonefile, generate a JS file, then use the JS file to see how different it is from the zonefile:
11781
11882
```shell
119-
dnscontrol get-zone --format=djs -out=foo.djs bind - example.com
83+
dnscontrol get-zones --format=djs --out=foo.djs my_bind example.com
12084
dnscontrol preview --config foo.js
12185
```
12286

documentation/language-reference/top-level-functions/NewDnsProvider.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,11 @@ A DSP stores a DNS zone's records and provides DNS service for the zone (i.e.
1414
answers on port 53 to queries related to the zone).
1515

1616
* `name` must match the name of an entry in `creds.json`.
17-
* `type` specifies a valid DNS provider type identifier listed on the [provider page](../../provider/index.md).
18-
* Starting with [v3.16](../../release/v316.md), the type is optional. If it is absent, the `TYPE` field in `creds.json` is used instead. You can leave it out. (Thanks to JavaScript magic, you can leave it out even when there are more fields).
19-
* Starting with v4.0, specifying the type may be an error. Please add the `TYPE` field to `creds.json` and remove this parameter from `dnsconfig.js` to prepare.
17+
* `type` is deprecated. The provider type is read from the `TYPE` field in `creds.json`.
2018
* `meta` is a way to send additional parameters to the provider. It is optional and only certain providers use it. See the [individual provider docs](../../provider/index.md) for details.
2119

2220
This function will return an opaque string that should be assigned to a variable name for use in [D](D.md) directives.
2321

24-
Prior to [v3.16](../../release/v316.md):
25-
26-
{% code title="dnsconfig.js" %}
27-
```javascript
28-
var REG_MYNDC = NewRegistrar("mynamedotcom", "NAMEDOTCOM");
29-
var DNS_MYAWS = NewDnsProvider("myaws", "ROUTE53");
30-
31-
D("example.com", REG_MYNDC, DnsProvider(DNS_MYAWS),
32-
A("@","1.2.3.4"),
33-
);
34-
```
35-
{% endcode %}
36-
37-
In [v3.16](../../release/v316.md) and later:
38-
3922
{% code title="dnsconfig.js" %}
4023
```javascript
4124
var REG_MYNDC = NewRegistrar("mynamedotcom");

documentation/language-reference/top-level-functions/NewRegistrar.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,11 @@ A registrar maintains the domain's registration and delegation (i.e. the
1616
nameservers for the domain). DNSControl only manages the delegation.
1717

1818
* `name` must match the name of an entry in `creds.json`.
19-
* `type` specifies a valid DNS provider type identifier listed on the [provider page](../../provider/index.md).
20-
* Starting with [v3.16](../../release/v316.md), the type is optional. If it is absent, the `TYPE` field in `creds.json` is used instead. You can leave it out. (Thanks to JavaScript magic, you can leave it out even when there are more fields).
21-
* Starting with v4.0, specifying the type may be an error. Please add the `TYPE` field to `creds.json` and remove this parameter from `dnsconfig.js` to prepare.
19+
* `type` is deprecated. The provider type is read from the `TYPE` field in `creds.json`.
2220
* `meta` is a way to send additional parameters to the provider. It is optional and only certain providers use it. See the [individual provider docs](../../provider/index.md) for details.
2321

2422
This function will return an opaque string that should be assigned to a variable name for use in [D](D.md) directives.
2523

26-
Prior to [v3.16](../../release/v316.md):
27-
28-
{% code title="dnsconfig.js" %}
29-
```javascript
30-
var REG_MYNDC = NewRegistrar("mynamedotcom", "NAMEDOTCOM");
31-
var DNS_MYAWS = NewDnsProvider("myaws", "ROUTE53");
32-
33-
D("example.com", REG_MYNDC, DnsProvider(DNS_MYAWS),
34-
A("@","1.2.3.4"),
35-
);
36-
```
37-
{% endcode %}
38-
39-
In [v3.16](../../release/v316.md) and later:
40-
4124
{% code title="dnsconfig.js" %}
4225
```javascript
4326
var REG_MYNDC = NewRegistrar("mynamedotcom");

0 commit comments

Comments
 (0)