mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-24 08:27:59 +08:00
9e6d642e35
Fixes https://github.com/StackExchange/dnscontrol/issues/1457 * New-style creds.json implememented backwards compatible * Update tests * Update docs * Assume new-style TYPE
42 lines
1.6 KiB
Markdown
42 lines
1.6 KiB
Markdown
---
|
|
name: NewRegistrar
|
|
parameters:
|
|
- name
|
|
- type
|
|
- meta
|
|
return: string
|
|
---
|
|
|
|
NewRegistrar activates a Registrar Provider specified in `creds.json`.
|
|
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.]({{site.github.url}}/provider-list).
|
|
* Starting with v3.16, 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.
|
|
* `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]({{site.github.url}}/provider-list) for details.
|
|
|
|
This function will return an opaque string that should be assigned to a variable name for use in [D](#D) directives.
|
|
|
|
Prior to v3.16:
|
|
|
|
```js
|
|
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 and later:
|
|
|
|
```js
|
|
var REG_MYNDC = NewRegistrar("mynamedotcom");
|
|
var DNS_MYAWS = NewDnsProvider("myaws");
|
|
|
|
D("example.com", REG_MYNDC, DnsProvider(DNS_MYAWS),
|
|
A("@","1.2.3.4")
|
|
);
|
|
```
|