IGNORE_NAME(a)is the same as
IGNORE(a, "*", "*").
--diff2=falseis used to revert to the old "diff1" algorithm,
IGNORE_NAME()behaves as follows:
IGNORE_*family of functions is risky to use. The code is brittle and has subtle bugs. Use at your own risk. Do not use these commands with
IGNORE_NAMEcan be used to ignore some records present in zone. Records of that name will be completely ignored. An optional
rTypesmay be specified as a comma separated list to only ignore records of the given type, e.g.
"A, MX, CNAME". If
rTypesis omitted or is
"*"all record types matching the name will be ignored.
NO_PURGEexcept it acts only on some specific records instead of the whole zone.
IGNORE_NAMEis a promise that DNSControl will not add, change, or delete records at a given label. This permits another entity to "own" that label.
IGNORE_NAMEis generally used in very specific situations:
- Some records are managed by some other system and DNSControl is only used to manage some records and/or keep them updated. For example a DNS
Arecord that is managed by a dynamic DNS client, or by Kubernetes External DNS, but DNSControl is used to manage the rest of the zone. In this case we don't want DNSControl to try to delete the externally managed record.
- To work-around a pseudo record type that is not supported by DNSControl. For example some providers have a fake DNS record type called "URL" which creates a redirect. DNSControl normally deletes these records because it doesn't understand them.
IGNORE_NAMEwill leave those records alone.
In this example, DNSControl will insert/update the "baz.example.com" record but will leave unchanged the "foo.example.com" and "bar.example.com" ones.
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
IGNORE_NAME("foo"), // ignore all record types for name foo
IGNORE_NAME("baz", "*"), // ignore all record types for name baz
IGNORE_NAME("bar", "A,MX"), // ignore only A and MX records for name bar
CNAME("bar", "www"), // CNAME is not ignored
IGNORE_NAMEalso supports glob patterns in the style of the gobwas/glob library. All of the following patterns will work:
IGNORE_NAME("*.foo")will ignore all records in the style of
bar.foo, but will not ignore records using a double subdomain, such as
IGNORE_NAME("**.foo")will ignore all subdomains of
foo, including double subdomains.
IGNORE_NAME("?oo")will ignore all records of three symbols ending in
oo, for example
zoo. It will not match
IGNORE_NAME("[abc]oo")will ignore records
IGNORE_NAME("[!abc]oo")will ignore all three symbol records ending in
oo, except for
IGNORE_NAME("\\*.foo")will ignore the literal record
It is considered as an error to try to manage an ignored record. Ignoring a label is a promise that DNSControl won't meddle with anything at a particular label, therefore DNSControl prevents you from adding records at a label that is
IGNORE_NAME("@")to ignore at the domain's apex. Most providers insert magic or unchangeable records at the domain's apex; usually
SOArecords. DNSControl treats them specially.
trying to update/add IGNORE_NAME'd record: foo CNAME
This means you have both ignored
fooand included a record (in this case, a CNAME) to update it. This is an error because
IGNORE_NAMEis a promise not to modify records at a certain label so that others may have free reign there. Therefore, DNSControl prevents you from modifying that label.
foo CNAMEat the end of the message indicates the label name (
foo) and the type of record (
CNAME) that your dnsconfig.js file is trying to insert.
You can override this error by adding the
IGNORE_NAME_DISABLE_SAFETY_CHECKflag to the record.
TXT("vpn", "this thing", IGNORE_NAME_DISABLE_SAFETY_CHECK)
Disabling this safety check creates two risks:
- 1.Two owners (DNSControl and some other entity) toggling a record between two settings.
- 2.The other owner wiping all records at this label, which won't be noticed until the next time DNSControl is run.