# NAMESERVER\_TTL

NAMESERVER\_TTL sets the TTL on the domain apex NS RRs defined by [`NAMESERVER`](/language-reference/domain-modifiers/nameserver.md).

The value can be an integer or a string. See [`TTL`](/language-reference/record-modifiers/ttl.md) for examples.

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

```javascript
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
  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" %}

```javascript
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
  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`](/language-reference/domain-modifiers/defaultttl.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dnscontrol.org/language-reference/domain-modifiers/nameserver_ttl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
