mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
DOCS: Added GitBook code blocks syntax for dnsconfig.js
. (#2149)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
committed by
GitHub
parent
af99942a3e
commit
05be3b83ed
@ -24,6 +24,7 @@ authorized certificate authorities and the builder cares about the rest.
|
||||
|
||||
For example you can use:
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
CAA_BUILDER({
|
||||
label: "@",
|
||||
@ -36,6 +37,7 @@ CAA_BUILDER({
|
||||
issuewild: "none",
|
||||
})
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
The parameters are:
|
||||
|
||||
@ -47,9 +49,11 @@ The parameters are:
|
||||
|
||||
`CAA_BUILDER()` returns multiple records (when configured as example above):
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
CAA("@", "iodef", "mailto:test@domain.tld", CAA_CRITICAL)
|
||||
CAA("@", "issue", "letsencrypt.org")
|
||||
CAA("@", "issue", "comodoca.com")
|
||||
CAA("@", "issuewild", ";")
|
||||
```
|
||||
{% endcode %}
|
||||
|
@ -39,6 +39,7 @@ DMARC policies for your domains.
|
||||
|
||||
### Simple example
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
DMARC_BUILDER({
|
||||
policy: 'reject',
|
||||
@ -47,6 +48,7 @@ DMARC_BUILDER({
|
||||
],
|
||||
})
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
This yield the following record:
|
||||
|
||||
@ -56,6 +58,7 @@ This yield the following record:
|
||||
|
||||
### Advanced example
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
DMARC_BUILDER({
|
||||
policy: 'reject',
|
||||
@ -72,8 +75,12 @@ DMARC_BUILDER({
|
||||
],
|
||||
failureOptions: '1',
|
||||
reportInterval: '1h',
|
||||
}),
|
||||
});
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
DMARC_BUILDER({
|
||||
label: 'insecure',
|
||||
policy: 'none',
|
||||
@ -84,8 +91,9 @@ DMARC_BUILDER({
|
||||
SPF: false,
|
||||
DKIM: true,
|
||||
},
|
||||
})
|
||||
});
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
This yields the following records:
|
||||
|
||||
|
@ -37,11 +37,13 @@ enforce the "10 lookup rule".
|
||||
|
||||
Here is an example of how SPF settings are normally done:
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.tld", REG, DNS, ...
|
||||
TXT("v=spf1 ip4:198.252.206.0/24 ip4:192.111.0.0/24 include:_spf.google.com include:mailgun.org include:spf-basic.fogcreek.com include:mail.zendesk.com include:servers.mcsv.net include:sendgrid.net include:450622.spf05.hubspotemail.net ~all")
|
||||
)
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
This has a few problems:
|
||||
|
||||
@ -51,6 +53,7 @@ This has a few problems:
|
||||
|
||||
## The DNSControl way
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.tld", REG, DSP, ...
|
||||
A("@", "10.2.2.2"),
|
||||
@ -80,6 +83,7 @@ D("example.tld", REG, DSP, ...
|
||||
}),
|
||||
);
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
By using the `SPF_BUILDER()` we gain many benefits:
|
||||
|
||||
@ -92,6 +96,7 @@ By using the `SPF_BUILDER()` we gain many benefits:
|
||||
When you want to specify SPF settings for a domain, use the
|
||||
`SPF_BUILDER()` function.
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.tld", REG, DSP, ...
|
||||
...
|
||||
@ -115,6 +120,7 @@ D("example.tld", REG, DSP, ...
|
||||
...
|
||||
);
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
The parameters are:
|
||||
|
||||
@ -283,6 +289,7 @@ record an include is added.
|
||||
In some situations we define an SPF setting once and want to re-use
|
||||
it on many domains. Here's how to do this:
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
var SPF_MYSETTINGS = SPF_BUILDER({
|
||||
label: "@",
|
||||
@ -306,3 +313,4 @@ D("example2.tld", REG, DSP, ...
|
||||
SPF_MYSETTINGS
|
||||
);
|
||||
```
|
||||
{% endcode %}
|
||||
|
@ -24,6 +24,7 @@ The value can be:
|
||||
* If no unit is specified, the default is seconds.
|
||||
* We highly recommend using units instead of the number of seconds. Would your coworkers understand your intention better if you wrote `14400` or `'4h'`?
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D('example.com', REGISTRAR, DnsProvider('R53'),
|
||||
DefaultTTL(2000),
|
||||
@ -33,3 +34,4 @@ D('example.com', REGISTRAR, DnsProvider('R53'),
|
||||
A('demo2', '3.4.5.12', TTL('5w')), // 5 weeks
|
||||
);
|
||||
```
|
||||
{% endcode %}
|
||||
|
Reference in New Issue
Block a user