How to Set Up Microsoft 365 Email With Your Domain

Email and Webmail | Updated July 2026

Microsoft 365 (formerly Office 365) lets you run your email on Microsoft's Exchange Online servers while keeping your own domain name, so your address stays [email protected] instead of an @outlook.com address. This guide walks through pointing your Ultra Web Hosting domain at Microsoft 365, the one cPanel setting that trips up almost everyone, and the DNS records that keep your mail out of the spam folder.

Do Not Skip This

The Remote Mail Exchanger Setting

The single most common reason Microsoft 365 mail fails on shared hosting: cPanel still thinks it delivers your mail. Even with a correct MX record, if Email Routing is left on Local Mail Exchanger, cPanel keeps messages on our server instead of sending them to Microsoft. Section 07 fixes this in two clicks.

  • Symptom: internal mail vanishes, or senders on your own domain never arrive
  • Cause: cPanel routes locally and ignores the external MX
  • Fix: cPanel > Email Routing > Remote Mail Exchanger

01. Microsoft 365 vs cPanel Email: What Changes

Every Ultra Web Hosting account already includes full email: you can create mailboxes in cPanel, read them in Webmail, and connect Outlook or your phone. Microsoft 365 replaces that mail service with Microsoft's Exchange Online while your website, files, and databases stay right here on our servers. It is a common choice for businesses that want the Outlook desktop and web apps, 50 GB or larger mailboxes, shared calendars, Teams, and the Office apps bundled in.

The important thing to understand is the split:

Stays on Ultra Web Hosting

Your Website

Your domain, DNS zone, website files, databases, FTP, and cPanel all remain with us. Nothing about your site moves.

  • Website and app hosting unchanged
  • You still manage DNS in cPanel Zone Editor
  • SSL, cron jobs, and everything else stay put
Prefer to Keep Email Here?

If you do not need the Office apps or Exchange features, your included cPanel email is a solid, no-extra-cost option. See How to Create Email Accounts and Aliases and How to Set Up Email in Microsoft Outlook. The steps in this guide are only for connecting a paid Microsoft 365 subscription.

02. Before You Start

You will need a few things in hand before touching any DNS:

  • A Microsoft 365 subscription - a Business Basic, Business Standard, or Enterprise plan that includes Exchange Online email. You buy this from Microsoft, not from us.
  • Global admin access to the Microsoft 365 admin center at admin.microsoft.com.
  • cPanel access for the domain on your Ultra Web Hosting account, so you can edit DNS in Zone Editor and change Email Routing.
  • Your domain on our nameservers - if your domain uses ns1.ultranameservers.com, ns2.ultranameservers.com, and ns3.ultranameservers.com, you manage DNS in cPanel. If your DNS is at Cloudflare or another provider, you add the same records there instead.
Where Is Your DNS?

Every record in this guide goes wherever your domain's DNS is actually hosted. Not sure? Run your domain through our DNS Lookup tool and check the nameservers. If they are ultranameservers.com, use cPanel Zone Editor. If they are Cloudflare or another host, make the changes there. Editing the zone in the wrong place is the second most common mistake after the routing setting.

03. Add Your Domain in the Microsoft 365 Admin Center

Microsoft needs to know your domain belongs to you before it will accept mail for it.

  1. Sign in at admin.microsoft.com with your Microsoft 365 global admin account.
  2. Go to Settings > Domains in the left menu.
  3. Click Add domain and type your domain name (for example yourdomain.com), then click Use this domain.
  4. Microsoft will offer to verify ownership. Choose the Add a TXT record to the domain's DNS records option. This is the safe choice on shared hosting because it does not require Microsoft to log in anywhere.
  5. Microsoft displays a TXT value that looks like MS=ms12345678. Copy it. You will paste it into cPanel in the next section.
Note

The setup wizard may offer to configure your DNS automatically. On Ultra Web Hosting you should decline that and add the records yourself, because your zone lives in cPanel (or at your DNS provider) and Microsoft cannot reach it directly. Choose the manual or "I'll manage my own DNS records" path.

04. Verify Domain Ownership with a TXT Record

Now add the verification TXT value in cPanel Zone Editor.

  1. Log in to cPanel and open Zone Editor (under the Domains section).
  2. Find your domain in the list and click Manage.
  3. Click + Add Record and choose type TXT.
  4. Set Name to your domain with a trailing dot, for example yourdomain.com. (the root of the zone).
  5. Set TTL to 3600.
  6. Paste the Record value Microsoft gave you, for example MS=ms12345678.
  7. Click Save Record.
  8. Wait a few minutes, return to the Microsoft admin center, and click Verify.
Tip

DNS changes are usually visible within minutes on our nameservers, but Microsoft's checker can lag. If verification fails on the first try, wait 15 minutes and click Verify again. You can confirm the record is live yourself with our DNS Lookup tool before retrying. For background on why changes are not always instant, see DNS Changed But Site Not Showing.

05. Point Your MX Record to Microsoft

The MX (Mail Exchanger) record is what tells the rest of the internet where to deliver your mail. This is the step that actually moves your email to Microsoft. Before adding the new one, remove any existing MX records that point to our mail server (they usually read mail.yourdomain.com or similar).

  1. In cPanel Zone Editor for your domain, find any existing MX record and click Delete. There should be no MX left pointing at our server once Microsoft is handling mail.
  2. Click + Add Record and choose type MX.
  3. Set Name to yourdomain.com. (the zone root, with trailing dot).
  4. Set Priority to 0.
  5. Set Destination to the value from the Microsoft admin center. It follows the pattern yourdomain-com.mail.protection.outlook.com (your domain name with the dot replaced by a hyphen).
  6. Set TTL to 3600 and click Save Record.
Get the Exact Value from Microsoft

Do not guess the MX hostname. Copy it from the Microsoft 365 admin center's DNS records page for your domain. The hyphenated prefix must match your domain exactly, or mail will bounce. For a refresher on how MX records work, see How Do I Change My MX Records.

06. Add the Autodiscover and SPF Records

Two more records make life easier: Autodiscover lets Outlook and phones configure themselves with just an email address and password, and SPF tells other mail servers that Microsoft is allowed to send on your behalf.

Autodiscover (CNAME)

  1. In Zone Editor, + Add Record, type CNAME.
  2. Name: autodiscover.yourdomain.com.
  3. CNAME / Destination: autodiscover.outlook.com.
  4. TTL: 3600. Save.

SPF (TXT)

Microsoft 365's SPF record authorizes Exchange Online to send mail for your domain. If an SPF record already exists (for example one we added for cPanel mail), replace it rather than adding a second one. A domain must have exactly one SPF record.

v=spf1 include:spf.protection.outlook.com -all
  1. In Zone Editor, delete any existing TXT record that begins with v=spf1.
  2. + Add Record, type TXT.
  3. Name: yourdomain.com. (zone root).
  4. Record: v=spf1 include:spf.protection.outlook.com -all
  5. TTL: 3600. Save.
Tip

If you also send mail from another service (a newsletter platform, your website's contact form relay, and so on), you merge their include into the same record rather than creating a second SPF record. Example: v=spf1 include:spf.protection.outlook.com include:_spf.example.com -all. Our SPF Record Generator builds a valid combined record, and our SPF guide explains the syntax.

07. Switch cPanel to Remote Mail Exchanger

This is the step people forget, and it causes the most confusing symptom: mail from people on your own domain, or from other sites hosted with us, silently never arrives. That happens because cPanel sees your domain on the same server and tries to deliver mail locally, ignoring your shiny new MX record.

  1. In cPanel, open Email Routing (under the Email section).
  2. Select your domain from the dropdown if you have more than one.
  3. Choose Remote Mail Exchanger.
  4. Click Change. That is it.

With Remote Mail Exchanger selected, cPanel hands every message off to whatever your MX record says, which is now Microsoft. Local delivery is disabled for the domain.

Also: Clean Up Old cPanel Mailboxes

If you had cPanel email accounts for this domain, mail sent from the server (for example WordPress notifications) can still try to drop into the old local mailbox. Once Microsoft 365 is confirmed working, remove the duplicate cPanel accounts so there is one place your mail lives. Do this only after you have verified Microsoft is receiving mail, and back up anything you still need first.

08. Enable DKIM and DMARC

MX, Autodiscover, and SPF are enough to send and receive mail. DKIM and DMARC are what keep that mail out of recipients' spam folders and stop others from spoofing your domain. Set them up as soon as basic mail flow works.

DKIM (two CNAME records)

  1. In the Microsoft 365 admin center, go to the Microsoft Defender portal at security.microsoft.com, then Email & collaboration > Policies & rules > Threat policies > Email authentication settings > DKIM.
  2. Select your domain. Microsoft shows two CNAME records to publish. They look like this:
    • Name: selector1._domainkey.yourdomain.com.Points to: selector1-yourdomain-com._domainkey.yourtenant.onmicrosoft.com.
    • Name: selector2._domainkey.yourdomain.com.Points to: selector2-yourdomain-com._domainkey.yourtenant.onmicrosoft.com.
  3. Add both as CNAME records in cPanel Zone Editor, copying Microsoft's exact values (the tenant name in the target is specific to your account).
  4. Back in the Defender portal, toggle DKIM signing to Enabled for the domain. If it complains the CNAMEs are not found, wait for DNS to propagate and try again.

DMARC (one TXT record)

DMARC ties SPF and DKIM together and tells receiving servers what to do with mail that fails both. Start in monitoring mode so you can watch reports before enforcing:

v=DMARC1; p=none; rua=mailto:[email protected]
  1. + Add Record in Zone Editor, type TXT.
  2. Name: _dmarc.yourdomain.com.
  3. Record: v=DMARC1; p=none; rua=mailto:[email protected]
  4. TTL: 3600. Save.

Once you have watched the reports for a couple of weeks and confirmed all your legitimate mail passes, tighten the policy to p=quarantine and eventually p=reject.

Tip

Use our free DKIM Lookup and DMARC Lookup tools to confirm the records resolve correctly. For the full picture on how these three records work together, read Understanding Email Authentication: SPF, DKIM, and DMARC.

09. Create Users and Test Mail Flow

With DNS in place, create the mailboxes and confirm mail moves both directions.

  1. In the Microsoft 365 admin center, go to Users > Active users > Add a user. Create each person with an address on your domain (for example [email protected]) and assign them a license that includes Exchange Online.
  2. Sign in to outlook.office.com as one of the new users to confirm the mailbox opened.
  3. Test inbound: from an outside account (a personal Gmail, say) send a message to the new address. It should arrive in Outlook within a minute or two.
  4. Test outbound: reply from the Microsoft 365 mailbox to that outside account and confirm it lands, ideally in the inbox rather than spam (which is what SPF, DKIM, and DMARC are for).
  5. Set up clients: because you added the Autodiscover record, the Outlook desktop app and phone mail apps configure themselves from just the email address and password. See How to Set Up Email in Microsoft Outlook if you want to add an account by hand.
Migrating from cPanel Email?

If you had existing mail in cPanel mailboxes, move it before you delete those accounts. The simplest path for a few mailboxes is to add both the old cPanel (IMAP) account and the new Microsoft 365 account in a desktop mail client, then drag the folders across. For many mailboxes, Microsoft's IMAP migration tool in the admin center can pull everything in bulk. Open a ticket if you would like a hand planning the move.

10. Troubleshooting Common Issues

Mail from my own domain never arrives, but outside mail does. Classic Local Mail Exchanger symptom. Go back to Section 07 and set Email Routing to Remote Mail Exchanger.

Microsoft will not verify the domain. The TXT record has not propagated yet, or it was added in the wrong place. Confirm your nameservers with our DNS Lookup tool, make sure the record is in that zone, and give it 15 to 30 minutes before retrying.

Outbound mail lands in recipients' spam. Almost always missing or wrong SPF/DKIM. Confirm there is exactly one SPF record and that it includes spf.protection.outlook.com, and that DKIM shows Enabled in the Defender portal. Check both with our SPF and DKIM lookups.

Two SPF records exist. A domain may have only one. Merge the includes into a single v=spf1 ... -all record and delete the extra.

Outlook keeps prompting for a password or will not auto-configure. Check that the Autodiscover CNAME points to autodiscover.outlook.com and has propagated. Without it, clients cannot find the server automatically.

Some mail still tries to deliver locally. An old cPanel mailbox for the domain still exists. Remove it once Microsoft 365 is confirmed working (Section 07 callout). For anything email-related that this guide does not cover, see the Email Troubleshooting Guide.

Want Us to Handle the DNS?

If you would rather not touch the zone yourself, send us the DNS records from your Microsoft 365 admin center and we will publish them and flip the routing for you. We support Microsoft 365, Google Workspace, and third-party mail on shared, VPS, and dedicated plans.

Open a Support Ticket

Quick Recap: Microsoft 365 in Six Steps

If you only do six things from this guide, do these:

  1. Add and verify your domain in the Microsoft 365 admin center using the TXT record it gives you.
  2. Point the MX record at yourdomain-com.mail.protection.outlook.com with priority 0, and delete the old MX.
  3. Add the Autodiscover CNAME and SPF TXT records so clients auto-configure and your mail passes SPF.
  4. Set cPanel Email Routing to Remote Mail Exchanger so cPanel stops delivering mail locally. This is the step everyone forgets.
  5. Enable DKIM and add DMARC to keep your mail out of the spam folder and stop spoofing.
  6. Create users and test mail in both directions before removing any old cPanel mailboxes.

Last updated July 2026 · Browse all Email and Webmail articles

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

Server Error 0x800CCC90, Error Number 0x900CCC92

Email & Webmail | Updated 2026 Error codes 0x800CCC90 and 0x800CCC92 in Microsoft Outlook...

POP3 vs IMAP - Choosing the Right Email Protocol

Email & Webmail | Updated March 2026 POP3 (Post Office Protocol version 3) is one of two...

How do I block emails containing zip attachments

Email & Webmail | Updated 2026 If you are receiving spam or phishing emails with .zip...

Cannot write to cache directory /tmp/horde

Email & Webmail | Updated 2026 If you see the error "Cannot write to cache directory...

Error 503 Valid RCPT Command Must Precede DATA

Email & Webmail | Updated March 2026 The error "503 valid RCPT command must precede DATA"...



Save 30% on web hosting - Use coupon code Hosting30