2021-09-03 03:41:22 +08:00
|
|
|
---
|
|
|
|
name: DOMAIN_ELSEWHERE_AUTO
|
|
|
|
parameters:
|
2023-01-23 00:20:15 +08:00
|
|
|
- name
|
2023-01-13 05:59:42 +08:00
|
|
|
- domain
|
2021-09-03 03:41:22 +08:00
|
|
|
- registrar
|
2023-01-13 05:59:42 +08:00
|
|
|
- dns provider
|
|
|
|
parameter_types:
|
2023-01-23 00:20:15 +08:00
|
|
|
name: string
|
2023-01-13 05:59:42 +08:00
|
|
|
domain: string
|
|
|
|
registrar: string
|
|
|
|
dns provider: string
|
2021-09-03 03:41:22 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
`DOMAIN_ELSEWHERE_AUTO()` is similar to `DOMAIN_ELSEWHERE()` but instead of
|
|
|
|
a hardcoded list of nameservers, a DnsProvider() is queried.
|
|
|
|
|
|
|
|
`DOMAIN_ELSEWHERE_AUTO` is useful when you control a domain's registrar but the
|
|
|
|
DNS zones are managed by another system. Luckily you have enough access to that
|
|
|
|
other system that you can query it to determine the zone's nameservers.
|
|
|
|
|
|
|
|
For example, suppose you own a domain but the DNS servers for it are in Azure.
|
|
|
|
Further suppose that something in Azure maintains the zones (automatic or
|
|
|
|
human). Azure picks the nameservers for the domains automatically, and that
|
|
|
|
list may change occasionally. `DOMAIN_ELSEWHERE_AUTO` allows you to easily
|
|
|
|
query Azure to determine the domain's delegations so that you do not need to
|
|
|
|
hard-code them in your dnsconfig.js file.
|
|
|
|
|
|
|
|
For example these two statements are equivalent:
|
|
|
|
|
2023-01-20 20:56:20 +08:00
|
|
|
```javascript
|
2021-09-03 03:41:22 +08:00
|
|
|
DOMAIN_ELSEWHERE_AUTO("example.com", REG_NAMEDOTCOM, DSP_AZURE);
|
|
|
|
|
2022-02-18 01:22:31 +08:00
|
|
|
// ...is equivalent to...
|
2021-09-03 03:41:22 +08:00
|
|
|
|
|
|
|
D("example.com", REG_NAMEDOTCOM,
|
|
|
|
NO_PURGE,
|
|
|
|
DnsProvider(DSP_AZURE)
|
|
|
|
);
|
|
|
|
```
|
|
|
|
|
2023-01-20 20:56:20 +08:00
|
|
|
{% hint style="info" %}
|
|
|
|
**NOTE**: The `NO_PURGE` is used to prevent DNSControl from changing the records.
|
|
|
|
{% endhint %}
|