1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

DOCS: Update example.md, add to comment SPF-record (#2073)

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
dkim1970
2023-02-19 16:59:03 +01:00
committed by GitHub
parent 43c5b17ed8
commit c012164cd4

View File

@ -92,28 +92,26 @@ D('example.com', REG, DnsProvider('R53'),
) )
``` ```
## Add comments along complex SPF records ## Use SPF_BUILDER to add comments along SPF records
You normally can't put comments in the middle of a string,
but with a little bit of creativity you can document
each element of an SPF record this way.
```javascript ```javascript
var SPF_RECORDS = TXT('@', [ D("example.tld", REG, DSP, ...
'v=spf1', A("@", "10.2.2.2"),
'ip4:1.2.3.0/24', // NY mail server MX("@", "example.tld."),
'ip4:4.3.2.0/24', // CO mail server SPF_BUILDER({
'include:_spf.google.com', // Google Apps label: "@",
'include:mailgun.org', // Mailgun (requested by Ticket#12345) overflow: "_spf%d",
'include:servers.mcsv.net', // MailChimp (requested by Ticket#54321) raw: "_rawspf",
'include:sendgrid.net', // SendGrid (requested by Ticket#23456) ttl: "5m",
'include:spf.mtasv.net', // Desk.com (needed by IT team) parts: [
'~all' "v=spf1",
].join(' ')); "ip4:198.252.206.0/24", // ny-mail*
"ip4:192.111.0.0/24", // co-mail*
D('example.com', REG, DnsProvider('R53'), "include:_spf.google.com", // GSuite
SPF_RECORDS, "~all"
) ]
}),
);
``` ```
## Dual DNS Providers ## Dual DNS Providers