Skip to content

namecheap.domain-nameservers resource

Description

DomainNameservers delegates a Namecheap domain to a set of custom nameservers, which turns off Namecheap's own DNS for the domain (and so cannot coexist with domain-records). The mode decides how it shares the delegation with nameservers it does not define. In overwrite mode it owns the whole set -- a write replaces every nameserver and a delete returns the domain to Namecheap's default DNS. In merge mode it owns only the nameservers it lists -- a write preserves any added elsewhere, and a delete removes only its own, returning to default DNS once none remain. The domain identifies the resource; changing it replaces the resource.

Source: internal/service/domain/nameservers_rsrc.go:26

Example usage:

imports: {
  namecheap: 'github.com/cloudboss/unobin-library-namecheap'
}

resources: {
  example: namecheap.domain-nameservers {
    # Set input fields here.
  }
}

Inputs

domain

string

required

mode

string

default MERGE

nameservers

list(string)

required

Input Constraints

Domain rules

domain is required.

Rule logic
Require
@core.length(input.domain) >= 1

Mode rules

mode must be MERGE or OVERWRITE.

Rule logic
Require
input.mode == 'MERGE'
|| input.mode == 'OVERWRITE'

Nameservers rules

a domain must have at least 2 nameservers.

Rule logic
Require
@core.length(input.nameservers) >= 2

Outputs

domain

string

mode

string

nameservers

list(string)