Skip to content

Commit

Permalink
GitBook: [#6] No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
cafferata authored and gitbook-bot committed Feb 4, 2023
1 parent 379c35a commit 8395615
Show file tree
Hide file tree
Showing 17 changed files with 242 additions and 210 deletions.
8 changes: 3 additions & 5 deletions documentation/functions/domain/A.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ parameters:
parameter_types:
name: string
address: string | number
modifiers...: RecordModifier[]
"modifiers...": RecordModifier[]
---

# A
A adds an A record To a domain. The name should be the relative label for the record. Use `@` for the domain apex.

`A` adds an A record To a domain. The name should be the relative label for the record. Use `@` for the domain apex.

The address should be an ip address, either a string, or a numeric value obtained via [`IP`](../global/IP.md).
The address should be an ip address, either a string, or a numeric value obtained via [IP](../global/IP.md).

Modifiers can be any number of [record modifiers](https://docs.dnscontrol.org/language-reference/record-modifiers) or JSON objects, which will be merged into the record's metadata.

Expand Down
6 changes: 2 additions & 4 deletions documentation/functions/domain/AAAA.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ parameters:
parameter_types:
name: string
address: string
modifiers...: RecordModifier[]
"modifiers...": RecordModifier[]
---

# AAAA

`AAAA` adds an AAAA record To a domain. The name should be the relative label for the record. Use `@` for the domain apex.
AAAA adds an AAAA record To a domain. The name should be the relative label for the record. Use `@` for the domain apex.

The address should be an IPv6 address as a string.

Expand Down
10 changes: 4 additions & 6 deletions documentation/functions/domain/ALIAS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ parameters:
parameter_types:
name: string
target: string
modifiers...: RecordModifier[]
"modifiers...": RecordModifier[]
---

# ALIAS
ALIAS is a virtual record type that points a record at another record. It is analogous to a CNAME, but is usually resolved at request-time and served as an A record. Unlike CNAMEs, ALIAS records can be used at the zone apex (`@`)

`ALIAS` is a virtual record type that points a record at another record. It is analogous to a [`CNAME`](CNAME.md), but is usually resolved at request-time and served as an A record. Unlike CNAMEs, ALIAS records can be used at the zone apex (`@`)

Different providers handle [`ALIAS`](ALIAS.md) records differently, and many do not support it at all. Attempting to use [`ALIAS`](ALIAS.md) records with a DNS provider type that does not support them will result in an error.
Different providers handle ALIAS records differently, and many do not support it at all. Attempting to use ALIAS records with a DNS provider type that does not support them will result in an error.

The name should be the relative label for the domain.

Target should be a string representing the 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 `.`.
Target should be a string representing the 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 `.`.

```javascript
D("example.com", REGISTRAR, DnsProvider("CLOUDFLARE"),
Expand Down
7 changes: 3 additions & 4 deletions documentation/functions/domain/AUTODNSSEC_OFF.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
name: AUTODNSSEC_OFF
---

# AUTODNSSEC\_OFF
AUTODNSSEC_OFF tells the provider to disable AutoDNSSEC. It takes no
parameters.

`AUTODNSSEC_OFF` tells the provider to disable AutoDNSSEC. It takes no parameters.

See [`AUTODNSSEC_ON`](AUTODNSSEC\_ON.md) for further details.
See `AUTODNSSEC_ON` for further details.
20 changes: 12 additions & 8 deletions documentation/functions/domain/AUTODNSSEC_ON.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
name: AUTODNSSEC_ON
---

# AUTODNSSEC\_ON
AUTODNSSEC_ON tells the provider to enable AutoDNSSEC.

`AUTODNSSEC_ON` tells the provider to enable AutoDNSSEC.
AUTODNSSEC_OFF tells the provider to disable AutoDNSSEC.

``[`AUTODNSSEC_OFF`](AUTODNSSEC\_OFF.md) tells the provider to disable AutoDNSSEC.
AutoDNSSEC is a feature where a DNS provider can automatically manage
DNSSEC for a domain. Not all providers support this.

AutoDNSSEC is a feature where a DNS provider can automatically manage DNSSEC for a domain. Not all providers support this.

At this time, `AUTODNSSEC_ON` takes no parameters. There is no ability to tune what the DNS provider sets, no algorithm choice. We simply ask that they follow their defaults when enabling a no-fuss DNSSEC data model.
At this time, AUTODNSSEC_ON takes no parameters. There is no ability
to tune what the DNS provider sets, no algorithm choice. We simply
ask that they follow their defaults when enabling a no-fuss DNSSEC
data model.

{% hint style="info" %}
**NOTE**: No parenthesis should follow these keywords. That is, the correct syntax is `AUTODNSSEC_ON` not `AUTODNSSEC_ON()`
**NOTE**: No parenthesis should follow these keywords. That is, the
correct syntax is `AUTODNSSEC_ON` not `AUTODNSSEC_ON()`
{% endhint %}

```javascript
Expand All @@ -28,4 +31,5 @@ D("insecure.com", .... ,
);
```

If neither `AUTODNSSEC_ON` or `AUTODNSSEC_OFF` is specified for a domain no changes will be requested.
If neither `AUTODNSSEC_ON` or `AUTODNSSEC_OFF` is specified for a
domain no changes will be requested.
9 changes: 4 additions & 5 deletions documentation/functions/domain/CNAME.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ parameters:
parameter_types:
name: string
target: string
modifiers...: RecordModifier[]
"modifiers...": RecordModifier[]
---

# CNAME
CNAME adds a CNAME record to the domain. The name should be the relative label for the domain.
Using `@` or `*` for CNAME records is not recommended, as different providers support them differently.

`CNAME` adds a CNAME record to the domain. The name should be the relative label for the domain. Using `@` or `*` for CNAME records is not recommended, as different providers support them differently.

Target should be a string representing the CNAME 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 `.`.
Target should be a string representing the CNAME 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 `.`.

```javascript
D("example.com", REGISTRAR, DnsProvider("R53"),
Expand Down
6 changes: 2 additions & 4 deletions documentation/functions/domain/DS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ parameter_types:
algorithm: number
digesttype: number
digest: string
modifiers...: RecordModifier[]
"modifiers...": RecordModifier[]
---

# DS

`DS` adds a DS record to the domain.
DS adds a DS record to the domain.

Key Tag should be a number.

Expand Down
8 changes: 4 additions & 4 deletions documentation/functions/domain/DefaultTTL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ parameter_types:
ttl: Duration
---

# DefaultTTL

`DefaultTTL` sets the TTL for all records in a domain that do not explicitly set one with [TTL](../record/TTL.md). If neither `DefaultTTL` or `TTL` exist for a record, it will use the DNSControl global default of 300 seconds.
DefaultTTL sets the TTL for all records in a domain that do not explicitly set one with [TTL](../record/TTL.md). If neither `DefaultTTL` or `TTL` exist for a record,
it will use the DNSControl global default of 300 seconds.

```javascript
D('example.com', REGISTRAR, DnsProvider('R53'),
Expand All @@ -18,4 +17,5 @@ D('example.com', REGISTRAR, DnsProvider('R53'),
);
```

The DefaultTTL duration is the same format as [TTL](../record/TTL.md), an integer number of seconds or a string with a unit such as `'4d'`.
The DefaultTTL duration is the same format as [TTL](../record/TTL.md), an integer number of seconds
or a string with a unit such as `'4d'`.
4 changes: 1 addition & 3 deletions documentation/functions/domain/IGNORE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: IGNORE
ts_ignore: true
---

# IGNORE

{% hint style="warning" %}
**WARNING**: IGNORE has been renamed to [`IGNORE_NAME`](IGNORE\_NAME.md). `IGNORE` will continue to function, but its use is deprecated. Please update your configuration files to use [`IGNORE_NAME`](IGNORE\_NAME.md).
**WARNING**: IGNORE has been renamed to `IGNORE_NAME`. IGNORE will continue to function, but its use is deprecated. Please update your configuration files to use `IGNORE_NAME`.
{% endhint %}
96 changes: 38 additions & 58 deletions documentation/functions/domain/IGNORE_NAME.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ parameter_types:
rTypes: string?
---

# IGNORE\_NAME

{% hint style="warning" %}
**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()`](../global/D\_EXTEND.md).
**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()`.
{% endhint %}

`IGNORE_NAME` can be used to ignore some records present in zone. Records of that name will be completely ignored. An optional `rTypes` may be specified as a comma separated list to only ignore records of the given type, e.g. `"A"`, `"A,CNAME"`, `"A, MX, CNAME"`. If `rTypes` is omitted or is `"*"` all record types matching the name will be ignored.
`IGNORE_NAME` can be used to ignore some records present in zone.
Records of that name will be completely ignored. An optional `rTypes` may be specified as a comma separated list to only ignore records of the given type, e.g. `"A"`, `"A,CNAME"`, `"A, MX, CNAME"`. If `rTypes` is omitted or is `"*"` all record types matching the name will be ignored.

`IGNORE_NAME` is like [`NO_PURGE`](NO\_PURGE.md) except it acts only on some specific records instead of the whole zone.
`IGNORE_NAME` is like `NO_PURGE` except it acts only on some specific records instead of the whole zone.

Technically `IGNORE_NAME` is a promise that DNSControl will not add, change, or delete records at a given label. This permits another entity to "own" that label.
Technically `IGNORE_NAME` is a promise that DNSControl will not add, change, or delete records at a given label. This permits another entity to "own" that label.

`IGNORE_NAME` is generally used in very specific situations:

Expand All @@ -37,69 +38,48 @@ D("example.com",
);
```

`IGNORE_NAME` also supports glob patterns in the style of the [gobwas/glob](https://github.com/gobwas/glob) library. All of the following patterns will work:

```javascript
IGNORE_NAME("*.foo")
```

Example above will ignore all records in the style of `bar.foo`, but will not ignore records using a double subdomain, such as `foo.bar.foo`.

```javascript
IGNORE_NAME("**.foo")
```

Example above will ignore all subdomains of `foo`, including double subdomains.

```javascript
IGNORE_NAME("?oo")
```

Example above will ignore all records of three symbols ending in `oo`, for example `foo` and `zoo`. It will not match `.`

```javascript
IGNORE_NAME("[abc]oo")
```

Example above will ignore records `aoo`, `boo` and `coo`. `IGNORE_NAME("[a-c]oo")` is equivalent.
`IGNORE_NAME` also supports glob patterns in the style of the [gobwas/glob](https://github.com/gobwas/glob) library. All of
the following patterns will work:

```javascript
IGNORE_NAME("[!abc]oo")
```
* `IGNORE_NAME("*.foo")` will ignore all records in the style of `bar.foo`, but will not ignore records using a double
subdomain, such as `foo.bar.foo`.
* `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 `foo` and `zoo`. It will
not match `.`
* `IGNORE_NAME("[abc]oo")` will ignore records `aoo`, `boo` and `coo`. `IGNORE_NAME("[a-c]oo")` is equivalent.
* `IGNORE_NAME("[!abc]oo")` will ignore all three symbol records ending in `oo`, except for `aoo`, `boo`, `coo`. `IGNORE_NAME("[!a-c]oo")` is equivalent.
* `IGNORE_NAME("{bar,[fz]oo}")` will ignore `bar`, `foo` and `zoo`.
* `IGNORE_NAME("\\*.foo")` will ignore the literal record `*.foo`.

Example above will ignore all three symbol records ending in `oo`, except for `aoo`, `boo`, `coo`. `IGNORE_NAME("[!a-c]oo")` is equivalent.
# Caveats

```javascript
IGNORE_NAME("{bar,[fz]oo}")
```
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`'ed.

Example above will ignore `bar`, `foo` and `zoo`.
Use `IGNORE_NAME("@")` to ignore at the domain's apex. Most providers
insert magic or unchangeable records at the domain's apex; usually `NS`
and `SOA` records. DNSControl treats them specially.

```javascript
IGNORE_NAME("\\*.foo")
```

Example above will ignore the literal record `*.foo`.

## Caveats

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`'ed.

Use `IGNORE_NAME("@")` to ignore at the domain's apex. Most providers insert magic or unchangeable records at the domain's apex; usually `NS` and `SOA` records. DNSControl treats them specially.

## Errors
# Errors

* `trying to update/add IGNORE_NAME'd record: foo CNAME`

This means you have both ignored `foo` and included a record (in this case, a CNAME) to update it. This is an error because `IGNORE_NAME` is 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.
This means you have both ignored `foo` and included a record (in this
case, a CNAME) to update it. This is an error because `IGNORE_NAME`
is 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.

The `foo CNAME` at 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.
The `foo CNAME` at 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_CHECK` flag to the record.
You can override this error by adding the
`IGNORE_NAME_DISABLE_SAFETY_CHECK` flag to the record.

```javascript
TXT('vpn', "this thing", IGNORE_NAME_DISABLE_SAFETY_CHECK)
```
TXT('vpn', "this thing", IGNORE_NAME_DISABLE_SAFETY_CHECK)

Disabling this safety check creates two risks:

Expand Down
43 changes: 12 additions & 31 deletions documentation/functions/domain/IGNORE_TARGET.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ parameter_types:
rType: string
---

# IGNORE\_TARGET

{% hint style="warning" %}
**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.
**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.
{% endhint %}

`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 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`](NO\_PURGE.md) except it acts only on some specific records instead of the whole zone.
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:
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`](CNAME.md) to "foo.acm-validations.aws" 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.

```javascript
D("example.com",
Expand All @@ -31,30 +31,11 @@ D("example.com",
);
```

`IGNORE_TARGET` also supports glob patterns in the style of the [gobwas/glob](https://github.com/gobwas/glob#example) library. Some example patterns:

```javascript
IGNORE_TARGET("example.com", "CNAME")
```

Example above will ignore all CNAME records with targets of exactly `example.com`.

```javascript
IGNORE_TARGET("*.foo", "CNAME")
```

Example above will ignore all CNAME records with targets in the style of `bar.foo`, but will not ignore records with targets using a double subdomain, such as `foo.bar.foo`.

```javascript
IGNORE_TARGET("**.bar", "CNAME")
```

Example above Example above will ignore all CNAME records with target subdomains of `bar`, including double subdomains such as `www.foo.bar`.

```javascript
IGNORE_TARGET("dev.*.foo", "CNAME")
```
IGNORE_TARGET also supports glob patterns in the style of the [gobwas/glob](https://github.com/gobwas/glob#example) library. Some example patterns:

Example above will ignore all [`CNAME`](CNAME.md) records with targets in the style of `dev.bar.foo`, but will not ignore records with targets using a double subdomain, such as `dev.foo.bar.foo`.
* `IGNORE_TARGET("example.com", "CNAME")` will ignore all CNAME records with targets of exactly `example.com`.
* `IGNORE_TARGET("*.foo", "CNAME")` will ignore all CNAME records with targets in the style of `bar.foo`, but will not ignore records with targets using a double subdomain, such as `foo.bar.foo`.
* `IGNORE_TARGET("**.bar", "CNAME")` will ignore all CNAME records with target subdomains of `bar`, including double subdomains such as `www.foo.bar`.
* `IGNORE_TARGET("dev.*.foo", "CNAME")` will ignore all CNAME records with targets in the style of `dev.bar.foo`, but will not ignore records with targets using a double subdomain, such as `dev.foo.bar.foo`.

It is considered as an error to try to manage an ignored record.
Loading

0 comments on commit 8395615

Please sign in to comment.