* Add example include * Replace example includes * Remove old example includes
2.1 KiB
name | parameters | ||
---|---|---|---|
IGNORE_TARGET |
|
WARNING: The 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 D_EXTEND()
or use it at the domain apex.
IGNORE_TARGET can be used to ignore some records present in zone based on the record's target and type. IGNORE_TARGET currently only supports CNAME record types.
IGNORE_TARGET is like NO_PURGE except it acts only on some specific records instead of the whole zone.
IGNORE_TARGET is 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 record that is created by AWS Certificate Manager for validation, 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.
In this example, DNSControl will insert/update the "baz.example.com" record but will leave unchanged a CNAME to "foo.acm-validations.aws" record.
{% capture example %}
D("example.com",
IGNORE_TARGET('**.acm-validations.aws.', 'CNAME'),
A("baz", "1.2.3.4")
);
{% endcapture %}
{% include example.html content=example %}
IGNORE_TARGET also supports glob patterns in the style of the gobwas/glob library. Some example patterns:
IGNORE_TARGET("example.com", "CNAME")
will ignore all CNAME records with targets of exactlyexample.com
.IGNORE_TARGET("*.foo", "CNAME")
will ignore all CNAME records with targets in the style ofbar.foo
, but will not ignore records with targets using a double subdomain, such asfoo.bar.foo
.IGNORE_TARGET("**.bar", "CNAME")
will ignore all CNAME records with target subdomains ofbar
, including double subdomains such aswww.foo.bar
.IGNORE_TARGET("dev.*.foo", "CNAME")
will ignore all CNAME records with targets in the style ofdev.bar.foo
, but will not ignore records with targets using a double subdomain, such asdev.foo.bar.foo
.
It is considered as an error to try to manage an ignored record.