From dfeef23a6875ebd890306535183cd0c27c03069e Mon Sep 17 00:00:00 2001 From: ajh0912 Date: Mon, 4 Nov 2024 17:35:22 +0000 Subject: [PATCH 1/7] Add mxHost label to M365_BUILDER --- pkg/js/helpers.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/js/helpers.js b/pkg/js/helpers.js index 88f52c0fe5..0940a7430a 100644 --- a/pkg/js/helpers.js +++ b/pkg/js/helpers.js @@ -1879,13 +1879,21 @@ function M365_BUILDER(name, value) { var r = []; + // MX host (default: "mail.protection.outlook.com") + if (!value.mxHost) { + value.mx = "mail.protection.outlook.com"; + } + // MX (default: true) if (value.mx) { r.push( MX( value.label, 0, - value.domainGUID + '.mail.protection.outlook.com.' + value.domainGUID + + '.' + + value.mxHost + + '.' ) ); } From 91a72082d2c61829a7a697c3372d7d237739689c Mon Sep 17 00:00:00 2001 From: ajh0912 Date: Mon, 4 Nov 2024 17:37:19 +0000 Subject: [PATCH 2/7] Add to mxHost to M365_BUILDER docs --- .../language-reference/domain-modifiers/M365_BUILDER.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/language-reference/domain-modifiers/M365_BUILDER.md b/documentation/language-reference/domain-modifiers/M365_BUILDER.md index 13ef4d1b37..88605084cf 100644 --- a/documentation/language-reference/domain-modifiers/M365_BUILDER.md +++ b/documentation/language-reference/domain-modifiers/M365_BUILDER.md @@ -66,6 +66,7 @@ This sets up Mobile Device Management only. * `label` The label of the Microsoft 365 domain, useful if it is a subdomain (default: `"@"`) * `mx` Set an `MX` record? (default: `true`) +* `mxHost` Set your MX host for Exchange Online (default: `mail.protection.outlook.com`) * `autodiscover` Set Autodiscover `CNAME` record? (default: `true`) * `dkim` Set DKIM `CNAME` records? (default: `true`) * `skypeForBusiness` Set Skype for Business/Microsoft Teams records? (default: `false`) From 45d12b6c370fa77f3777e4f61522eb852ad9fb41 Mon Sep 17 00:00:00 2001 From: ajh0912 Date: Mon, 4 Nov 2024 17:37:59 +0000 Subject: [PATCH 3/7] Change existing example name in M365_BUILDER docs --- .../language-reference/domain-modifiers/M365_BUILDER.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/language-reference/domain-modifiers/M365_BUILDER.md b/documentation/language-reference/domain-modifiers/M365_BUILDER.md index 88605084cf..7b1fa86ed1 100644 --- a/documentation/language-reference/domain-modifiers/M365_BUILDER.md +++ b/documentation/language-reference/domain-modifiers/M365_BUILDER.md @@ -42,7 +42,7 @@ END); This sets up `MX` records, Autodiscover, and DKIM. -### Advanced example +### Example with MDM only {% code title="dnsconfig.js" %} ```javascript From 4814564deb928cd0fcb2fdd886415240f3d0a236 Mon Sep 17 00:00:00 2001 From: ajh0912 Date: Mon, 4 Nov 2024 17:56:00 +0000 Subject: [PATCH 4/7] Add new example for all services and DNSSEC MX in M365_BUILDER --- .../domain-modifiers/M365_BUILDER.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/documentation/language-reference/domain-modifiers/M365_BUILDER.md b/documentation/language-reference/domain-modifiers/M365_BUILDER.md index 7b1fa86ed1..ca7a9aa887 100644 --- a/documentation/language-reference/domain-modifiers/M365_BUILDER.md +++ b/documentation/language-reference/domain-modifiers/M365_BUILDER.md @@ -62,6 +62,29 @@ END); This sets up Mobile Device Management only. +### Example with all services and DNSSEC MX + +{% code title="dnsconfig.js" %} +```javascript +D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), + M365_BUILDER("example.com", { + mx: true, // Can be omitted as default: true + mxHost: "o-v1.mx.microsoft", // Override the default mail.protection.outlook.com + autodiscover: true, // Can be omitted as default: true + dkim: true, // Can be omitted as default: true + skypeForBusiness: true, + mdm: true, + initialDomain: "example.onmicrosoft.com", + }), +END); +``` +{% endcode %} + +This sets up MX (custom), AutoDiscover, DKIM, Skype for Business/Microsoft Teams and Mobile Device Management records. + +Instead of the default MX target ending in `mail.protection.outlook.com`, this example uses `.mx.microsoft` which is a DNSSEC signed zone. +`` is obtained from Microsoft after [enabling DNSSEC functionality for the domain](https://learn.microsoft.com/purview/how-smtp-dane-works#inbound-smtp-dane-with-dnssec) within Exchange Online. + ### Parameters * `label` The label of the Microsoft 365 domain, useful if it is a subdomain (default: `"@"`) From 3d6bf11a04ea0ebe723c62f6eef107d66109492f Mon Sep 17 00:00:00 2001 From: ajh0912 Date: Mon, 4 Nov 2024 18:11:37 +0000 Subject: [PATCH 5/7] Format helpers.js --- pkg/js/helpers.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pkg/js/helpers.js b/pkg/js/helpers.js index 0940a7430a..371ae77fe8 100644 --- a/pkg/js/helpers.js +++ b/pkg/js/helpers.js @@ -1881,21 +1881,12 @@ function M365_BUILDER(name, value) { // MX host (default: "mail.protection.outlook.com") if (!value.mxHost) { - value.mx = "mail.protection.outlook.com"; + value.mx = 'mail.protection.outlook.com'; } // MX (default: true) if (value.mx) { - r.push( - MX( - value.label, - 0, - value.domainGUID + - '.' + - value.mxHost + - '.' - ) - ); + r.push(MX(value.label, 0, value.domainGUID + '.' + value.mxHost + '.')); } // Autodiscover (default: true) From 7b46549f710f46e3b69d2b774e3287c87d20f1ea Mon Sep 17 00:00:00 2001 From: ajh0912 Date: Mon, 4 Nov 2024 19:13:56 +0000 Subject: [PATCH 6/7] Update types after go generate --- commands/types/dnscontrol.d.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/commands/types/dnscontrol.d.ts b/commands/types/dnscontrol.d.ts index 2315a8424b..91ece6b990 100644 --- a/commands/types/dnscontrol.d.ts +++ b/commands/types/dnscontrol.d.ts @@ -1863,7 +1863,7 @@ declare function LOC_BUILDER_STR(opts: { label?: string; str: string; alt?: numb * * This sets up `MX` records, Autodiscover, and DKIM. * - * ### Advanced example + * ### Example with MDM only * * ```javascript * D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), @@ -1881,10 +1881,32 @@ declare function LOC_BUILDER_STR(opts: { label?: string; str: string; alt?: numb * * This sets up Mobile Device Management only. * + * ### Example with all services and DNSSEC MX + * + * ```javascript + * D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), + * M365_BUILDER("example.com", { + * mx: true, // Can be omitted as default: true + * mxHost: "o-v1.mx.microsoft", // Override the default mail.protection.outlook.com + * autodiscover: true, // Can be omitted as default: true + * dkim: true, // Can be omitted as default: true + * skypeForBusiness: true, + * mdm: true, + * initialDomain: "example.onmicrosoft.com", + * }), + * END); + * ``` + * + * This sets up MX (custom), AutoDiscover, DKIM, Skype for Business/Microsoft Teams and Mobile Device Management records. + * + * Instead of the default MX target ending in `mail.protection.outlook.com`, this example uses `.mx.microsoft` which is a DNSSEC signed zone. + * `` is obtained from Microsoft after [enabling DNSSEC functionality for the domain](https://learn.microsoft.com/purview/how-smtp-dane-works#inbound-smtp-dane-with-dnssec) within Exchange Online. + * * ### Parameters * * * `label` The label of the Microsoft 365 domain, useful if it is a subdomain (default: `"@"`) * * `mx` Set an `MX` record? (default: `true`) + * * `mxHost` Set your MX host for Exchange Online (default: `mail.protection.outlook.com`) * * `autodiscover` Set Autodiscover `CNAME` record? (default: `true`) * * `dkim` Set DKIM `CNAME` records? (default: `true`) * * `skypeForBusiness` Set Skype for Business/Microsoft Teams records? (default: `false`) From 4b2c832af496dd342272edce500d4119f1f8c0b7 Mon Sep 17 00:00:00 2001 From: ajh0912 Date: Mon, 4 Nov 2024 20:07:30 +0000 Subject: [PATCH 7/7] Update parameter_types frontmatter for M365_BUILDER --- .../language-reference/domain-modifiers/M365_BUILDER.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/language-reference/domain-modifiers/M365_BUILDER.md b/documentation/language-reference/domain-modifiers/M365_BUILDER.md index ca7a9aa887..1db0361798 100644 --- a/documentation/language-reference/domain-modifiers/M365_BUILDER.md +++ b/documentation/language-reference/domain-modifiers/M365_BUILDER.md @@ -13,6 +13,7 @@ parameters_object: true parameter_types: label: string? mx: boolean? + mxHost: string? autodiscover: boolean? dkim: boolean? skypeForBusiness: boolean?