diff --git a/documentation/advanced-features/nameservers.md b/documentation/advanced-features/nameservers.md index b5a760995..b71fa64af 100644 --- a/documentation/advanced-features/nameservers.md +++ b/documentation/advanced-features/nameservers.md @@ -69,7 +69,6 @@ D("example.com", REG_NAMECOM, ``` {% endcode %} - ## Registrar is elsewhere Purpose: @@ -91,6 +90,30 @@ D("example.com", REG_NONE, ``` {% endcode %} +## Domain is "nowhere" + +Suppose you don't want to manage a domain, but you want to list the zone in +your `dnsconfig.js` file for inventory purposes. For example, suppose there are +domains that some other part of your company maintains, but you want to list it +in your `dnsconfig.js` because it is authoratative for the company. + +```javascript +var REG_NONE = NewRegistrar("none"); + +function INVENTORY_ONLY(name) { + D(name, REG_NONE, { no_ns: "true" }); +} + +INVENTORY_ONLY('example.com"); +INVENTORY_ONLY('example2.com"); +INVENTORY_ONLY('example.net"); +``` + +Now you can produce a list of your zones like this: + +```shell +dnscontrol print-ir | jq -r '.domains[].name' +``` ## Zone is elsewhere diff --git a/documentation/language-reference/top-level-functions/D.md b/documentation/language-reference/top-level-functions/D.md index 637b0d417..08d450e3f 100644 --- a/documentation/language-reference/top-level-functions/D.md +++ b/documentation/language-reference/top-level-functions/D.md @@ -24,7 +24,8 @@ Modifier arguments are processed according to type as follows: {% code title="dnsconfig.js" %} ```javascript // simple domain -D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), +D("example.com", REG_MY_PROVIDER, + DnsProvider(DSP_MY_PROVIDER), A("@","1.2.3.4"), // "@" means the apex domain. In this case, "example.com" itself. CNAME("test", "foo.example2.com."), ); @@ -53,6 +54,34 @@ In other words, if you want to put a DNS record at the apex of a domain, use an In the above example, `example.com` has an `A` record with the value `"1.2.3.4"` at the apex of the domain. {% endhint %} +# `no_ns` + +To prevent DNSControl from accidentally deleting your nameservers (at the +parent domain), registrar updates are disabled if the list of nameservers for a +zone (as computed from `dnsconfig.js`) is empty. + +This can happen when a provider doesn't give any control over the apex NS +records, there are no default nameservers, and the provider returns an empty +list of nameservers (such as Gandi and Vercel). + +In this situation, you will see an error message such as: + +``` +Skipping registrar REGISTRAR: No nameservers declared for domain "example.com". Add {no_ns:'true'} to force +``` + +To add this, add the meta data to the zone immediately following the registrar. + +```javascript +D("example.com", REG_MY_PROVIDER, {no_ns:'true'}, + ... + ... + ... +); +``` + +Note that the value `true` is a string. + # Split Horizon DNS DNSControl supports Split Horizon DNS. Simply