From c012164cd46da0b7034e51972da6cc51575a35d5 Mon Sep 17 00:00:00 2001 From: dkim1970 <118921779+dkim1970@users.noreply.github.com> Date: Sun, 19 Feb 2023 16:59:03 +0100 Subject: [PATCH] DOCS: Update example.md, add to comment SPF-record (#2073) Co-authored-by: Tom Limoncelli --- documentation/examples.md | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/documentation/examples.md b/documentation/examples.md index e65c033bc..fd96e357e 100644 --- a/documentation/examples.md +++ b/documentation/examples.md @@ -92,28 +92,26 @@ D('example.com', REG, DnsProvider('R53'), ) ``` -## Add comments along complex 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. +## Use SPF_BUILDER to add comments along SPF records ```javascript -var SPF_RECORDS = TXT('@', [ - 'v=spf1', - 'ip4:1.2.3.0/24', // NY mail server - 'ip4:4.3.2.0/24', // CO mail server - 'include:_spf.google.com', // Google Apps - 'include:mailgun.org', // Mailgun (requested by Ticket#12345) - 'include:servers.mcsv.net', // MailChimp (requested by Ticket#54321) - 'include:sendgrid.net', // SendGrid (requested by Ticket#23456) - 'include:spf.mtasv.net', // Desk.com (needed by IT team) - '~all' -].join(' ')); - -D('example.com', REG, DnsProvider('R53'), - SPF_RECORDS, -) +D("example.tld", REG, DSP, ... + A("@", "10.2.2.2"), + MX("@", "example.tld."), + SPF_BUILDER({ + label: "@", + overflow: "_spf%d", + raw: "_rawspf", + ttl: "5m", + parts: [ + "v=spf1", + "ip4:198.252.206.0/24", // ny-mail* + "ip4:192.111.0.0/24", // co-mail* + "include:_spf.google.com", // GSuite + "~all" + ] + }), +); ``` ## Dual DNS Providers