github.com/StackExchange/dnscontrol/v4@v4.11.0/documentation/language-reference/top-level-functions/DEFAULTS.md (about) 1 --- 2 name: DEFAULTS 3 parameters: 4 - modifiers... 5 parameter_types: 6 "modifiers...": DomainModifier[] 7 --- 8 9 `DEFAULTS` allows you to declare a set of default arguments to apply to all subsequent domains. Subsequent calls to [`D`](D.md) will have these 10 arguments passed as if they were the first modifiers in the argument list. 11 12 ## Example 13 14 We want to create backup zone files for all domains, but not actually register them. Also create a [`DefaultTTL`](../domain-modifiers/DefaultTTL.md). 15 The domain `example.com` will have the defaults set. 16 17 {% code title="dnsconfig.js" %} 18 ```javascript 19 var COMMON = NewDnsProvider("foo"); 20 DEFAULTS( 21 DnsProvider(COMMON, 0), 22 DefaultTTL("1d"), 23 END); 24 25 D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), 26 A("@","1.2.3.4"), 27 END); 28 ``` 29 {% endcode %} 30 31 If you want to clear the defaults, you can do the following. 32 The domain `example2.com` will **not** have the defaults set. 33 34 {% code title="dnsconfig.js" %} 35 ```javascript 36 DEFAULTS(); 37 38 D("example2.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), 39 A("@","1.2.3.4"), 40 END); 41 ``` 42 {% endcode %}