2020-01-21 03:07:38 +08:00
## Configuration
2022-05-09 02:41:33 +08:00
To use this provider, add an entry to `creds.json` with `TYPE` set to `CLOUDNS`
along with your [Api user ID and password ](https://www.cloudns.net/wiki/article/42/ ).
Example:
2020-01-21 03:07:38 +08:00
2023-03-03 05:17:27 +08:00
{% code title="creds.json" %}
2022-02-18 01:22:31 +08:00
```json
2020-01-21 03:07:38 +08:00
{
"cloudns": {
2022-05-09 02:41:33 +08:00
"TYPE": "CLOUDNS",
2020-01-21 03:07:38 +08:00
"auth-id": "12345",
2020-12-23 02:32:00 +08:00
"sub-auth-id": "12345",
2020-01-21 03:07:38 +08:00
"auth-password": "your-password"
}
}
2022-02-18 01:22:31 +08:00
```
2023-03-03 05:17:27 +08:00
{% endcode %}
2020-01-21 03:07:38 +08:00
2022-05-09 02:41:33 +08:00
Current version of provider doesn't support `sub-auth-user` .
2020-12-23 02:32:00 +08:00
## Records
2021-01-23 01:54:39 +08:00
ClouDNS does support DS Record on subdomains (not the apex domain itself).
ClouDNS requires NS records exist for any DS records. No other records for
the same label may exist (A, MX, TXT, etc.). If DNSControl is adding NS and
DS records in the same update, the NS records will be inserted first.
2020-12-23 02:32:00 +08:00
2020-01-21 03:07:38 +08:00
## Metadata
This provider does not recognize any special metadata fields unique to ClouDNS.
2022-03-02 22:21:51 +08:00
## Web Redirects
ClouDNS supports ClouDNS-specific "WR record (web redirects)" for your domains.
Simply use the `CLOUDNS_WR` functions to make redirects like any other record:
2023-03-11 21:42:01 +08:00
{% code title="dnsconfig.js" %}
2023-01-20 20:56:20 +08:00
```javascript
2022-05-09 02:41:33 +08:00
var REG_NONE = NewRegistrar("none");
var DSP_CLOUDNS = NewDnsProvider("cloudns");
2022-03-02 22:21:51 +08:00
2022-05-09 02:41:33 +08:00
D("example.tld", REG_NONE, DnsProvider(DSP_CLOUDNS),
CLOUDNS_WR("@", "http://example.com/"),
CLOUDNS_WR("www", "http://example.com/")
2022-03-02 22:21:51 +08:00
)
```
2023-03-11 21:42:01 +08:00
{% endcode %}
2022-03-02 22:21:51 +08:00
2020-01-21 03:07:38 +08:00
## Usage
2023-03-11 21:42:01 +08:00
An example configuration:
2020-01-21 03:07:38 +08:00
2023-03-11 21:42:01 +08:00
{% code title="dnsconfig.js" %}
2023-01-20 20:56:20 +08:00
```javascript
2022-05-09 02:41:33 +08:00
var REG_NONE = NewRegistrar("none");
var DSP_CLOUDNS = NewDnsProvider("cloudns");
2020-01-21 03:07:38 +08:00
2022-05-09 02:41:33 +08:00
D("example.tld", REG_NONE, DnsProvider(DSP_CLOUDNS),
A("test", "1.2.3.4")
2020-01-21 03:07:38 +08:00
);
2022-02-18 01:22:31 +08:00
```
2023-03-11 21:42:01 +08:00
{% endcode %}
2020-01-21 03:07:38 +08:00
## Activation
2021-05-15 21:38:27 +08:00
[Create Auth ID ](https://www.cloudns.net/api-settings/ ). Only paid account can use API
2020-01-21 03:07:38 +08:00
## Caveats
2021-05-15 21:38:27 +08:00
ClouDNS does not allow all TTLs, only a specific subset of TTLs. By default, the following [TTLs are supported ](https://www.cloudns.net/wiki/article/188/ ):
2020-01-21 03:07:38 +08:00
- 60 (1 minute)
- 300 (5 minutes)
- 900 (15 minutes)
- 1800 (30 minutes)
- 3600 (1 hour)
- 21600 (6 hours)
- 43200 (12 hours)
- 86400 (1 day)
- 172800 (2 days)
- 259200 (3 days)
- 604800 (1 week)
- 1209600 (2 weeks)
- 2419200 (4 weeks)
The provider will automatically round up your TTL to one of these values. For example, 350 seconds would become 900
2022-02-18 01:22:31 +08:00
seconds, but 300 seconds would stay 300 seconds.