Note: The SharePoint Online Public Website information in this article applies only if your organization purchased Office 365 prior to March 9, 2015. If you purchased Office 365 after March 9, 2015, use an Office 365 website hosting partner.
Before you rename the site to use your custom domain name, make sure that you've finished designing the website (in Office 365) and that you're ready for everyone to see it. Then, when you're ready to use your custom domain for the address, you create (at the DNS host for your domain) a CNAME record to point to your customized website.
Ready to create that CNAME record at Cloudflare? Follow the steps in this article. (Need more help? Get support.)
Add the CNAME record to use your custom domain
First, review one of the two following linked articles (depending on the Office 365 subscription that you have) for an overview of the process.
If you’re using Office 365 Small Business, get an overview of the process by reading Use a custom domain name to rename your Office 365 public website.
If you have any other subscription of Office 365, review the instructions in Rename your SharePoint Online Public Website address to use your custom domain.
Then, when you’re ready to create the required CNAME record, use the steps in the following section.
To get started, go to your domains page at Cloudflare by using this link. You'll be prompted to log in first.
On the Overview page, in the Select Website area, choose the domain that you want to update.
On the Overview page for your domain, choose DNS.
Important: By default, Cloudflare creates a system record that enables the “www” prefix for your domain. The presence of this A Record prevents you from creating the CNAME Record required for redirecting your website to SharePoint. To create the required CNAME Record, you must first deactivate the A Record associated with your www.domain_name.
Delete the “www” A Record for Your Domain
On the DNS Records page, delete the A Record that maps to the www value in the Name column, by choosing the X (delete) control.
On the Confirm screen, choose OK.
Important: We recommend that you copy and save all the Record information on this page in an archive document or screenshot. This ensures that you will be able to re-create the required A Record if you make configuration changes in the future.
Add the Required CNAME Record
On the DNS Records page, in the boxes for the new record, type or copy and paste the values from the following table.
(Select the DNS Record Type value from the drop-down list.)
Where domain_name is the name of your custom domain (for example, www.contoso.com.)
name is the name of your custom domain (for example, contoso.sharepoint.com.)
Choose Add Record.
Note: Typically it takes about 15 minutes for DNS changes to take effect. However, it can occasionally take longer for a change you've made to update across the Internet's DNS system. If you’re having trouble with mail flow or other issues after adding DNS records, see Troubleshoot issues after changing your domain name or DNS records.
Set up redirection so that people can get to your public website if they don’t type www
Cloudflare does not support DNS Redirects (see their statement below). You instead need to use Cloudflare’s page rules. We do not recommend using this approach unless you have advanced experience with page forwarding rules and implementations.
For more information about redirection, see Make sure people can get to your Office 365 public website if they don’t type www.