Microsoft offers an online environment called Microsoft 365 (formerly Office 365). It includes components such as Exchange for e-mail and Lync for internet telephony.
If you want to use Microsoft 365, you need to configure the correct DNS records for your domain name. This guide explains how to successfully link your domain to Microsoft 365. You can also refer to our DNS guide if you need more information about editing DNS records.
Microsoft 365 for business requires a custom domain. With Microsoft 365 for home use, you cannot link your own domain. This means that if you want to use a personalised email, you must have a Microsoft 365 business subscription.
Home or personal subscriptions only allow you to use Microsoft-provided e-mail addresses (such as
outlook.comorhotmail.com) and do not support connecting a custom domain for e-mail or other services.
Connect Microsoft 365
1. To use your own domain with Microsoft 365, you need a Business or Enterprise subscription. Home subscriptions do not support custom domain integration. You can purchase a subscription through the Microsoft 365 website.
2. Sign in to the Microsoft 365 Admin Center using your administrator credentials. Navigate to 'Settings' → 'Domains'.
3. Click on 'Add domain'. Enter your domain name (e.g., yourdomain.com) and click 'Use this domain'.
4. Microsoft will provide a TXT record to verify domain ownership. Copy this value (e.g., MS=ms12345678).
5. Log in to DirectAdmin and navigate to 'Account Management' → 'DNS Management'. Add a new TXT record with the following details:
-
Name:
@ -
Type:
TXT -
Value: The TXT value provided by Microsoft (e.g.,
MS=ms12345678) -
TTL:
3600seconds (or the default value)
Save the changes. DNS propagation can take up to 48 hours, but typically it's much faster.
6. Return to the Microsoft 365 Admin Center and click 'Verify'. Microsoft will check for the TXT record you added. Once verified, your domain will be listed as 'Verified'.
7. After verification, you will need to configure additional DNS records to enable services like e-mail, Teams, and OneDrive. Microsoft provides the necessary DNS records (MX, CNAME, TXT, SRV) in the Admin Center. These records should be added to your DNS settings as per Microsoft's instructions.
8. Once all DNS records are added and propagated, return to the Microsoft 365 Admin Center and click 'Finish setup'. Your domain is now fully integrated with Microsoft 365.
Updating your DNS settings for Microsoft 365 integration
To link your domain to Microsoft 365, you need to manually update a few DNS records so your mail points to Microsoft's servers. Follow these steps:
1. Log in to DirectAdmin.
2. In the menu, go to 'Account Management' → 'DNS Management'.
3. Remove the existing e-mail records from the list. You can do this by checking the boxes next to them and clicking 'Delete'. This applies to all MX records and any TXT record that starts with v=spf1.
4. Create the DNS records for e-mail, keeping the following points in mind:
Set the MX record priority to 0, and make sure to enter all dots and hyphens exactly as shown.
In the MX record, replace example.com with your own domain name and example-com with your own unique MX token.
In the SPF record, also replace example.com with your own domain name to ensure accurate mail authentication.
Example:
example.com. MX 0 example-com.mail.protection.outlook.com. autodiscover CNAME autodiscover.outlook.com. example.com. TXT "v=spf1 a mx ip4:195.211.72.0/22 ip4:141.138.168.0/21 ip6:2a03:3c00:a001::/48 ip6:2a03:3c00:a002::/48 include:spf.protection.outlook.com ~all"
5. Disable local mail handling by navigating to to 'E-mail Manager' → 'MX Records'.
6. Uncheck 'Use this server to handle my e-mails' and click 'Save'.