2017-08-15 10:46:31 -07:00
---
name: NS
parameters:
- name
- target
- modifiers...
2023-01-12 16:59:42 -05:00
parameter_types:
name: string
target: string
"modifiers...": RecordModifier[]
2017-08-15 10:46:31 -07:00
---
NS adds a NS record to the domain. The name should be the relative label for the domain.
2020-01-29 13:47:32 -05:00
2023-03-13 19:42:08 +01:00
The name may not be `@` (the bare domain), as that is controlled via [`NAMESERVER()` ](NAMESERVER.md ).
The difference between `NS()` and [`NAMESERVER()` ](NAMESERVER.md ) is explained in the [`NAMESERVER()` description ](NAMESERVER.md ).
2020-01-29 13:47:32 -05:00
2017-08-15 10:46:31 -07:00
Target should be a string representing the NS target. If it is a single label we will assume it is a relative name on the current domain. If it contains *any* dots, it should be a fully qualified domain name, ending with a `.` .
2023-03-13 21:30:21 +01:00
{% code title="dnsconfig.js" %}
2023-01-20 13:56:20 +01:00
```javascript
2023-06-18 05:35:13 +02:00
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
2019-05-21 04:33:50 +02:00
NS("foo", "ns1.example2.com."), // Delegate ".foo.example.com" zone to another server.
NS("foo", "ns2.example2.com."), // Delegate ".foo.example.com" zone to another server.
2017-08-15 10:46:31 -07:00
A("ns1.example2.com", "10.10.10.10"), // Glue records
A("ns2.example2.com", "10.10.10.20"), // Glue records
);
2022-02-17 18:22:31 +01:00
```
2023-03-13 21:30:21 +01:00
{% endcode %}