1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00
Jeffrey Cafferata 05be3b83ed DOCS: Added GitBook code blocks syntax for dnsconfig.js. (#2149)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
2023-03-13 16:30:21 -04:00

1.1 KiB

name parameters parameter_types
NAMESERVER_TTL
ttl
ttl target modifiers...
Duration string RecordModifier[]

NAMESERVER_TTL sets the TTL on the domain apex NS RRs defined by NAMESERVER.

The value can be an integer or a string. See TTL for examples.

{% code title="dnsconfig.js" %}

D('example.com', REGISTRAR, DnsProvider('R53'),
  NAMESERVER_TTL('2d'),
  NAMESERVER('ns')
);

{% endcode %}

Use NAMESERVER_TTL('3600'), or NAMESERVER_TTL('1h'), for a 1h default TTL for all subsequent NS entries:

{% code title="dnsconfig.js" %}

D('example.com', REGISTRAR, DnsProvider('xyz'),
  DefaultTTL("4h"),
  NAMESERVER_TTL('3600'),
  NAMESERVER('ns1.provider.com.'), //inherits NAMESERVER_TTL
  NAMESERVER('ns2.provider.com.'), //inherits NAMESERVER_TTL
  A('@','1.2.3.4'), // inherits DefaultTTL
  A('foo', '2.3.4.5', TTL(600)) // overrides DefaultTTL for this record only
);

{% endcode %}

To apply a default TTL to all other record types, see DefaultTTL