diff --git a/commands/getZones.go b/commands/getZones.go index f60b844fa2..7fc5d11fd4 100644 --- a/commands/getZones.go +++ b/commands/getZones.go @@ -24,57 +24,52 @@ var _ = cmd(catUtils, func() *cli.Command { Aliases: []string{"get-zone"}, Usage: "gets a zone from a provider (stand-alone)", Action: func(ctx context.Context, c *cli.Command) error { - if c.NArg() < 3 { - return cli.Exit("Arguments should be: credskey providername zone(s) (Ex: r53 ROUTE53 example.com)", 1) + if c.NArg() < 2 { + return cli.Exit("Arguments should be: credskey zone(s) (Ex: my_cloudflare example.com)", 1) } args.CredName = c.Args().Get(0) - arg1 := c.Args().Get(1) - args.ProviderName = arg1 - // In v4.0, skip the first args.ZoneNames if it equals "-". - args.ZoneNames = c.Args().Slice()[2:] - - if arg1 != "" && arg1 != "-" { - // NB(tlim): In v4.0 this "if" can be removed. - fmt.Fprintf(os.Stderr, "WARNING: To retain compatibility in future versions, please change %q to %q. See %q\n", - arg1, "-", - "https://docs.dnscontrol.org/commands/get-zones", - ) + if c.NArg() == 2 || c.Args().Get(1) == "-" { + args.ProviderName = "" + if c.Args().Get(1) == "-" { + args.ZoneNames = c.Args().Slice()[2:] + } else { + args.ZoneNames = c.Args().Slice()[1:] + } + } else { + arg1 := c.Args().Get(1) + if _, ok := providers.DNSProviderTypes[arg1]; ok { + // Deprecated form: credkey provider zone [...] + args.ProviderName = arg1 + args.ZoneNames = c.Args().Slice()[2:] + fmt.Fprintf(os.Stderr, "WARNING: The provider name argument is deprecated. Please use \"dnscontrol get-zones %s %s\" instead. See %q\n", + args.CredName, strings.Join(args.ZoneNames, " "), + "https://docs.dnscontrol.org/commands/get-zones", + ) + } else { + // New form with multiple zones: credkey zone1 zone2 [...] + args.ProviderName = "" + args.ZoneNames = c.Args().Slice()[1:] + } } return exit(GetZone(args)) }, Flags: args.flags(), - UsageText: "dnscontrol get-zones [command options] credkey provider zone [...]", + UsageText: "dnscontrol get-zones [command options] credkey zone [...]", Description: `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) - provider: The name of the provider (second parameter to NewDnsProvider() in dnsconfig.js) + credkey: The name used in creds.json 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`, } }()) @@ -120,7 +115,9 @@ ARGUMENTS: EXAMPLES: dnscontrol check-creds myr53 ROUTE53 # Pre v3.16, or pre-v4.0 for backwards-compatibility dnscontrol check-creds myr53 - dnscontrol check-creds --out=/dev/null myr53 && echo Success`, + dnscontrol check-creds --out=/dev/null myr53 && echo Success + +Documentation: https://docs.dnscontrol.org/commands/check-creds`, } }()) diff --git a/commands/types/dnscontrol.d.ts b/commands/types/dnscontrol.d.ts index 8769d4ca0e..b407a80c73 100644 --- a/commands/types/dnscontrol.d.ts +++ b/commands/types/dnscontrol.d.ts @@ -2783,26 +2783,11 @@ declare function NS(name: string, target: string, ...modifiers: RecordModifier[] * answers on port 53 to queries related to the zone). * * * `name` must match the name of an entry in `creds.json`. - * * `type` specifies a valid DNS provider type identifier listed on the [provider page](../../provider/index.md). - * * 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). - * * 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. + * * `type` is deprecated. The provider type is read from the `TYPE` field in `creds.json`. * * `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. * * This function will return an opaque string that should be assigned to a variable name for use in [D](D.md) directives. * - * Prior to [v3.16](../../release/v316.md): - * - * ```javascript - * var REG_MYNDC = NewRegistrar("mynamedotcom", "NAMEDOTCOM"); - * var DNS_MYAWS = NewDnsProvider("myaws", "ROUTE53"); - * - * D("example.com", REG_MYNDC, DnsProvider(DNS_MYAWS), - * A("@","1.2.3.4"), - * ); - * ``` - * - * In [v3.16](../../release/v316.md) and later: - * * ```javascript * var REG_MYNDC = NewRegistrar("mynamedotcom"); * var DNS_MYAWS = NewDnsProvider("myaws"); @@ -2822,26 +2807,11 @@ declare function NewDnsProvider(name: string, meta?: object): string; * nameservers for the domain). DNSControl only manages the delegation. * * * `name` must match the name of an entry in `creds.json`. - * * `type` specifies a valid DNS provider type identifier listed on the [provider page](../../provider/index.md). - * * 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). - * * 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. + * * `type` is deprecated. The provider type is read from the `TYPE` field in `creds.json`. * * `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. * * This function will return an opaque string that should be assigned to a variable name for use in [D](D.md) directives. * - * Prior to [v3.16](../../release/v316.md): - * - * ```javascript - * var REG_MYNDC = NewRegistrar("mynamedotcom", "NAMEDOTCOM"); - * var DNS_MYAWS = NewDnsProvider("myaws", "ROUTE53"); - * - * D("example.com", REG_MYNDC, DnsProvider(DNS_MYAWS), - * A("@","1.2.3.4"), - * ); - * ``` - * - * In [v3.16](../../release/v316.md) and later: - * * ```javascript * var REG_MYNDC = NewRegistrar("mynamedotcom"); * var DNS_MYAWS = NewDnsProvider("myaws"); diff --git a/documentation/SUMMARY.md b/documentation/SUMMARY.md index f0e79a6b4b..08e0b75588 100644 --- a/documentation/SUMMARY.md +++ b/documentation/SUMMARY.md @@ -229,5 +229,4 @@ ## Release * [How to build and ship a release](release/release-engineering.md) -* [Changelog v3.16.0](release/v316.md) * [GitHub releases](https://github.com/DNSControl/dnscontrol/releases/latest) diff --git a/documentation/commands/check-creds.md b/documentation/commands/check-creds.md index a84fa2359b..7511f79e55 100644 --- a/documentation/commands/check-creds.md +++ b/documentation/commands/check-creds.md @@ -8,38 +8,21 @@ successful, a list of zones will be output (which may be an empty list). If the ```text Syntax: - dnscontrol check-creds [command options] credkey provider + dnscontrol check-creds [command options] credkey --creds value Provider credentials JSON file (default: "creds.json") --out value Instead of stdout, write to this file ARGUMENTS: - credkey: The name used in creds.json (first parameter to NewDnsProvider() in dnsconfig.js) - provider: The name of the provider (second parameter to NewDnsProvider() in dnsconfig.js) + credkey: The name used in creds.json ``` -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. - -Starting in v4.0, the "provider" argument is expected to go away. +The provider type is read from the `TYPE` field in `creds.json`. ## Examples ```shell -dnscontrol check-creds myr53 ROUTE53 -``` - -Starting in [v3.16](../release/v316.md): - -```shell -dnscontrol check-creds myr53 -dnscontrol check-creds myr53 - -dnscontrol check-creds myr53 ROUTE53 -``` - -Starting in v4.0: - -```shell -dnscontrol check-creds myr53 +dnscontrol check-creds my_route53 ``` This command is the same as `get-zones` with `--format=nameonly` diff --git a/documentation/commands/creds-json.md b/documentation/commands/creds-json.md index 83d6e11b94..efcfcc47a2 100644 --- a/documentation/commands/creds-json.md +++ b/documentation/commands/creds-json.md @@ -42,15 +42,9 @@ Here's a sample file: * ...may include any JSON string value including the empty string. * 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. -## New in v3.16 +## The TYPE subkey -The special subkey "TYPE" is used to indicate the provider type (NONE, CLOUDFLAREAPI, GCLOUD, etc). - -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`. - -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. - -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. +The special subkey "TYPE" is required in each `creds.json` entry. It indicates the provider type (NONE, CLOUDFLAREAPI, GCLOUD, etc). ## Error messages @@ -114,11 +108,7 @@ Examples: ``` {% endcode %} -Starting with [v3.16](../release/v316.md) use of an OLD format will trigger warnings with suggestions on how to adopt the NEW format. - -Starting with v4.0 support for the OLD format may be reported as an error. - -Please adopt the NEW format when your installation has eliminated any use of DNSControl pre-3.16. +Use of the OLD format will trigger warnings with suggestions on how to adopt the NEW format. ### mismatch diff --git a/documentation/commands/get-zones.md b/documentation/commands/get-zones.md index 82724dda1b..3d002cd69d 100644 --- a/documentation/commands/get-zones.md +++ b/documentation/commands/get-zones.md @@ -33,7 +33,7 @@ If a provider supports it, `--format=nameonly` lists the names of the zones at t ## Syntax ```shell -dnscontrol get-zones [command options] credkey provider zone [...] +dnscontrol get-zones [command options] credkey zone [...] --creds value Provider credentials JSON file (default: "creds.json") --format value Output format: js djs zone tsv nameonly (default: "zone") @@ -42,13 +42,10 @@ dnscontrol get-zones [command options] credkey provider zone [...] ARGUMENTS: credkey: The name used in creds.json (first parameter to NewDnsProvider() in dnsconfig.js) -provider: The name of the provider (second parameter to NewDnsProvider() in dnsconfig.js) zone: One or more zones (domains) to download; or "all". ``` -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. - -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. +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. ```shell FORMATS: @@ -73,50 +70,17 @@ The `--ttl` flag only applies to zone/js/djs formats. ## Examples ```shell -dnscontrol get-zones myr53 ROUTE53 example.com -dnscontrol get-zones gmain GANDI_V5 example.comn 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 glcoud GCLOUD example.com -``` - -As of [v3.16](../release/v316.md): - -```shell -# NOTE: When "-" appears as the 2nd argument, it is assumed that the -# creds.json entry has a field TYPE with the provider's type name. -dnscontrol get-zones gmain GANDI_V5 example.comn other.com -dnscontrol get-zones gmain - example.comn other.com -dnscontrol get-zones cfmain CLOUDFLAREAPI all -dnscontrol get-zones cfmain - all -dnscontrol get-zones --format=tsv bind BIND example.com -dnscontrol get-zones --format=tsv bind - example.com -dnscontrol get-zones --format=djs --out=draft.js glcoud GCLOUD example.com -dnscontrol get-zones --format=djs --out=draft.js glcoud - example.com -``` - -As of v4.0: - -```shell -dnscontrol get-zones gmain example.comn other.com -dnscontrol get-zones cfmain all -dnscontrol get-zones --format=tsv bind example.com -dnscontrol get-zones --format=djs --out=draft.js glcoud example.com -``` - -For backwards compatibility, these are valid until at least v5.0 - -```shell -dnscontrol get-zones gmain - example.comn other.com -dnscontrol get-zones cfmain - all -dnscontrol get-zones --format=tsv bind - example.com -dnscontrol get-zones --format=djs --out=draft.js glcoud - 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 ``` Read a zonefile, generate a JS file, then use the JS file to see how different it is from the zonefile: ```shell -dnscontrol get-zone --format=djs -out=foo.djs bind - example.com +dnscontrol get-zones --format=djs --out=foo.djs my_bind example.com dnscontrol preview --config foo.js ``` diff --git a/documentation/language-reference/top-level-functions/NewDnsProvider.md b/documentation/language-reference/top-level-functions/NewDnsProvider.md index 5783fcdc51..70ea1e9011 100644 --- a/documentation/language-reference/top-level-functions/NewDnsProvider.md +++ b/documentation/language-reference/top-level-functions/NewDnsProvider.md @@ -14,28 +14,11 @@ A DSP stores a DNS zone's records and provides DNS service for the zone (i.e. answers on port 53 to queries related to the zone). * `name` must match the name of an entry in `creds.json`. -* `type` specifies a valid DNS provider type identifier listed on the [provider page](../../provider/index.md). - * 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). - * 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. +* `type` is deprecated. The provider type is read from the `TYPE` field in `creds.json`. * `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. This function will return an opaque string that should be assigned to a variable name for use in [D](D.md) directives. -Prior to [v3.16](../../release/v316.md): - -{% code title="dnsconfig.js" %} -```javascript -var REG_MYNDC = NewRegistrar("mynamedotcom", "NAMEDOTCOM"); -var DNS_MYAWS = NewDnsProvider("myaws", "ROUTE53"); - -D("example.com", REG_MYNDC, DnsProvider(DNS_MYAWS), - A("@","1.2.3.4"), -); -``` -{% endcode %} - -In [v3.16](../../release/v316.md) and later: - {% code title="dnsconfig.js" %} ```javascript var REG_MYNDC = NewRegistrar("mynamedotcom"); diff --git a/documentation/language-reference/top-level-functions/NewRegistrar.md b/documentation/language-reference/top-level-functions/NewRegistrar.md index 89d5643087..8470556c59 100644 --- a/documentation/language-reference/top-level-functions/NewRegistrar.md +++ b/documentation/language-reference/top-level-functions/NewRegistrar.md @@ -16,28 +16,11 @@ A registrar maintains the domain's registration and delegation (i.e. the nameservers for the domain). DNSControl only manages the delegation. * `name` must match the name of an entry in `creds.json`. -* `type` specifies a valid DNS provider type identifier listed on the [provider page](../../provider/index.md). - * 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). - * 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. +* `type` is deprecated. The provider type is read from the `TYPE` field in `creds.json`. * `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. This function will return an opaque string that should be assigned to a variable name for use in [D](D.md) directives. -Prior to [v3.16](../../release/v316.md): - -{% code title="dnsconfig.js" %} -```javascript -var REG_MYNDC = NewRegistrar("mynamedotcom", "NAMEDOTCOM"); -var DNS_MYAWS = NewDnsProvider("myaws", "ROUTE53"); - -D("example.com", REG_MYNDC, DnsProvider(DNS_MYAWS), - A("@","1.2.3.4"), -); -``` -{% endcode %} - -In [v3.16](../../release/v316.md) and later: - {% code title="dnsconfig.js" %} ```javascript var REG_MYNDC = NewRegistrar("mynamedotcom"); diff --git a/documentation/release/v316.md b/documentation/release/v316.md deleted file mode 100644 index f82c8b5b17..0000000000 --- a/documentation/release/v316.md +++ /dev/null @@ -1,229 +0,0 @@ -# creds.json file format change - -**Feel free to skip to "How do I convert?" if you don't care about the details.** - -Starting in v3.16 the "provider type identifier" (PTI) will be located in `creds.json` instead of `dnsconfig.js`. The PTI is the all caps string like `ROUTE53` or `CLOUDFLAREAPI` used to identify a provider's type. - -V3.16 will enable a syntax that is backwards and forwards compatible. The old syntax will be removed in v4.0. There's no planned release date for v4.0 but it is expected to be after Dec 31, 2022. - -The change was discussed in [Request for Comments: Include the provider type in creds.json, remove it from dnsconfig.js](https://github.com/DNSControl/dnscontrol/issues/1457) where we decided "Plan A" would be selected. - -# What does this mean to you? - -In a nutshell, `NewRegistrar()` and `NewDnsProvider()` will lose the 2nd parameter: - -{% code title="dnsconfig.js" %} -```diff -var REG_GANDI = NewRegistrar( -- "gandi", -- "GANDI_V5" -+ "gandi" -); -var DSP_CF = NewDnsProvider( -- "cloudflare_tal", -- "CLOUDFLAREAPI" -+ "cloudflare_tal" -); -``` -{% endcode %} - -The second parameter (`GANDI_V5` and `CLOUDFLAREAPI` in the above examples) has moved to `creds.json` instead. It will be in a `TYPE` field, which all providers have. It can appear in both places for backwards compatibility for now. - -{% code title="creds.json" %} -```diff -{ - "gandi": { -+ "TYPE": "GANDI_V5", - "apikey": "reacted" - }, - "cloudflare_tal": { -+ "TYPE": "CLOUDFLAREAPI", - "apikey": "reacted", - "apiuser": "reacted" - } -} -``` -{% endcode %} - -In the past, a provider didn't need an entry in `creds.json` if there were no credentials to be stored. Starting in v4.0 all providers must have an entry in `creds.json`. To aid the transition, starting in v3.16 warnings will appear on stdout that direct you to convert to the new format. - -Also to help in the conversion, if no provider named "none" or "bind" exist, ones will be added for you. They look like this: - -{% code title="creds.json" %} -```json -{ - "none": { "TYPE": "NONE" }, - "bind": { "TYPE": "BIND" } -} -``` -{% endcode %} - -# Command line tools - -How does this affect command line tools? - -The following subcommands require the PTI a parameter on the command line: - -* `get-zone` -* `get-zones` -* `check-creds` - -In 3.16, that parameter can be changed to `-` as a placeholder, or removed entirely if it is the last parameter on the command line. When you omit this parameter, DNSControl will find the value in `creds.json` instead. - -In 4.0, that parameter will be removed, though a `-` is permitted for backwards compatibility. - -In other words, if you add the `TYPE` field to `creds.json`, you no longer need to specify it on the command line. You can specify `-` instead, or leave it out entirely starting in v4.0. - -For check-creds: - -Starting in v3.16 these forms are valid: - -```shell -dnscontrol check-creds myr53 -dnscontrol check-creds myr53 - -dnscontrol check-creds myr53 ROUTE53 -``` - -Starting in v4.0 this is the only valid form: - -```shell -dnscontrol check-creds myr53 -``` - -For backwards compatibility, these are valid until at least v5.0: - -```shell -dnscontrol check-creds myr53 - -``` - -For get-zones/get-zone: - -Starting in v3.16 these forms are valid: - -```shell -dnscontrol get-zones gmain GANDI_V5 example.comn other.com -dnscontrol get-zones gmain - example.comn other.com -dnscontrol get-zones cfmain CLOUDFLAREAPI all -dnscontrol get-zones cfmain - all -dnscontrol get-zones --format=tsv bind BIND example.com -dnscontrol get-zones --format=tsv bind - example.com -dnscontrol get-zones --format=djs --out=draft.js glcoud GCLOUD example.com -dnscontrol get-zones --format=djs --out=draft.js glcoud - example.com -``` - -Starting in v4.0 these forms are valid: - -```shell -dnscontrol get-zones gmain example.comn other.com -dnscontrol get-zones cfmain all -dnscontrol get-zones --format=tsv bind example.com -dnscontrol get-zones --format=djs --out=draft.js glcoud example.com -``` - -For backwards compatibility, these are valid until at least v5.0: - -```shell -dnscontrol get-zones gmain - example.comn other.com -dnscontrol get-zones cfmain - all -dnscontrol get-zones --format=tsv bind - example.com -dnscontrol get-zones --format=djs --out=draft.js glcoud - example.com -``` - -# How do I convert? - -## Step 1: Upgrade - -Upgrade to v3.16 or later. If DNSControl is installed in many places, do not continue until they are all at v3.16 or later. - -## Step 2: Edit creds.json - -Now that all uses of DNSControl are on v3.16 or later... - -For each `creds.json` entry, add a field "TYPE" set to the provider type identifier. This is the all-caps name such as `ROUTE53`, `GCLOUD`, or `CLOUDFLAREAPI`. - -For example, here is a new-style `creds.json` file with `TYPE` fields added: - -{% code title="creds.json" %} -```diff -{ - "bind_inside": { -+ "TYPE": "BIND", - "directory": "inzones" - }, - "cloudflare_tal": { -+ "TYPE": "CLOUDFLAREAPI", - "apikey": "redacted", - "apiuser": "redacted" - }, - "gandi": { -+ "TYPE": "GANDI_V5", - "apikey": "redacted" - } -} -``` -{% endcode %} - -## Step 3: Cross-check - -Run `dnscontrol preview` as one normally would. Fix any errors, warnings, or informational messages that appear on stdout. - -Here are some examples: - -If you see something like... - -```text -WARNING: For future compatibility, update the "namedotcom_main" entry in `creds.json` by adding: "TYPE": "NAMEDOTCOM", (See https://docs.dnscontrol.org/commands/creds-json#missing) -``` - -...it means that the TYPE field is missing from that entry in `creds.json`. - -If you see something like... - -```text -ERROR: Mismatch found! creds.json entry "namedotcom_main" has "TYPE" set to "ROUTE53" but dnsconfig.js specifies New*("namedotcom_main", "NAMEDOTCOM") (See https://docs.dnscontrol.org/commands/creds-json#mismatch) -``` - -...it means your `dnsconfig.js` and `creds.json` specify mismatched values. Fix one or the other. - -After you correct some warnings, you may receive information messages like... - -```text -INFO: In dnsconfig.js New*("namedotcom_main", "NAMEDOTCOM") can be simplified to New*("namedotcom_main") (See https://docs.dnscontrol.org/commands/creds-json#cleanup) -``` - -...which is a message that will disappear as you update `dnsconfig.js` in the next step. - -## Step 4: Edit dnsconfig.js - -Remove the 2nd parameter to any NewDnsProvider() or NewRegistrar() functions. - -{% code title="dnsconfig.js" %} -```diff -var REG_NAMEDOTCOM_TAL = NewRegistrar( -- "namedotcom_tal", -- "NAMEDOTCOM" -+ "namedotcom_tal" -); -var DNS_GANDI_TAL = NewDnsProvider( -- "gandi_v5_tal", -- "GANDI_V5" -+ "gandi_v5_tal" -); -``` -{% endcode %} - -Again, run `dnscontrol preview` to verify you setup still works as expected. - -## Step 5: Update any shell scripts - -Any shell scripts or documentation that uses the subcommands `get-zone`, `get-zones` or `check-creds` should be updated. The "provider type" parameter should be changed to `-`. If it is the last parameter on the command, it can be removed. - -It's unlikely you have scripts that use these commands. However you may have documentation that refers to them and needs to be updated. - -## Step 4: Test - -Run `dnscontrol preview` as one normally would. Fix any errors, warnings, or informational messages that appear on stdout. - -## Step 5: Done - -That's it!