# M365\_BUILDER

DNSControl offers a `M365_BUILDER` which can be used to simply set up Microsoft 365 for a domain in an opinionated way.

It defaults to a setup without support for legacy Skype for Business applications. It doesn't set up SPF or DMARC. See [`SPF_BUILDER`](/language-reference/domain-modifiers/spf_builder.md) and [`DMARC_BUILDER`](/language-reference/domain-modifiers/dmarc_builder.md).

### Example

#### Simple example

{% code title="dnsconfig.js" %}

```javascript
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
  M365_BUILDER("example.com", {
      initialDomain: "example.onmicrosoft.com",
  }),
);
```

{% endcode %}

This sets up `MX` records, Autodiscover, and DKIM.

#### Advanced example

{% code title="dnsconfig.js" %}

```javascript
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
  M365_BUILDER("example.com", {
      label: "test",
      mx: false,
      autodiscover: false,
      dkim: false,
      mdm: true,
      domainGUID: "test-example-com", // Can be automatically derived in this case, if example.com is the context.
      initialDomain: "example.onmicrosoft.com",
  }),
);
```

{% endcode %}

This sets up Mobile Device Management only.

#### Parameters

* `label` The label of the Microsoft 365 domain, useful if it is a subdomain (default: `"@"`)
* `mx` Set an `MX` record? (default: `true`)
* `autodiscover` Set Autodiscover `CNAME` record? (default: `true`)
* `dkim` Set DKIM `CNAME` records? (default: `true`)
* `skypeForBusiness` Set Skype for Business/Microsoft Teams records? (default: `false`)
* `mdm` Set Mobile Device Management records? (default: `false`)
* `domainGUID` The GUID of *this* Microsoft 365 domain (default: `<label>.<context>` with `.` replaced by `-`, no default if domain contains dashes)
* `initialDomain` The initial domain of your Microsoft 365 tenant/account, ends in `onmicrosoft.com`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dnscontrol.org/language-reference/domain-modifiers/m365_builder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
