To add a custom domain, like fourthcoffee.com, to Office 365, you follow the steps in the domains setup wizard.
If you already have a website outside of Office 365 that uses the domain you’re adding, like www.fourthcoffee.com, select No, I have an existing website or prefer to manage my own DNS records. Then the wizard will guide you to set up your domain with your domain's DNS records hosted at your current DNS host. If you don't have a website, you can opt to have Office 365 set up and manage DNS for your domain instead.
Want to have Office 365 manage DNS for your domain anyway (not recommended)? You must redirect to your current website
This is not the recommended option if you already have a website outside Office 365 that uses your domain (unless you've set up an outside website using one of Office 365's web hosting partners). We recommend that you continue to manage your domain's DNS at your current DNS host to help prevent problems with access to your current website when you set up your domain with Office 365.
If you still want Office 365 to manage DNS for your domain, you may be able to set up redirection from Office 365 to your current website. If you don't set up redirection using a static address for your website, people won't be able to get to your website after you add your domain to Office 365 and change your domain's nameservers to point to Office 365 nameservers.
Why is access to your website affected? Because nameserver settings tell web browsers, and other Internet services, where to look for your domain. After you change your domain's nameservers to Office 365, so Office 365 can manage DNS for your domain, web browsers will look for your website at Office 365. Since your website is hosted by a different service, the site won't be found.
Add your domain to Office 365 and set up redirection to your website
Before you begin, you will need a static IP address or FQDN for your current website. Contact your website hosting provider to get the IP address or FQDN. (Using a dynamic IP address, such as the address returned when you run a program like Ping, will not let you set up reliable redirection because the IP address can change at any time.)
Add your domain to Office 365, following the steps in the domains setup wizard.
In the wizard, choose the option that you do not have a website with your domain. Do not change your domain's nameserver records in the setup wizard until you complete the following step.
Follow these steps to create an A record to redirect traffic to your website, using the static IP address (or FQDN) that you got from your current website hosting provider.
We recommend that you also create a CNAME record to help make sure that your customers will find your website whether or not they include www together with your domain name. Follow these steps to add the CNAME record in Office 365 in Office 365.
If the option to create an A record or CNAME record is not available, see Can't update the A record or CNAME record?.
Complete the final step of the domains setup wizard, to change your nameserver records to point to the Office 365 nameservers.
Now that you’ve got email accounts and website redirection set up, you can update your domain nameserver (NS) records for the domain to point to Office 365. By setting up email addresses and the A record first, as described above, you and other people in your organization will have email accounts that use the domain address, and your website will still be available at your current website hosting provider after you change the NS records.
Note: When you change your domain’s NS records as described here, you change the destination of domain services, such as email, to point to Office 365. Remember—if you’re already using the domain for email outside Office 365, make sure that you've created Office 365 email addresses with the domain for your users (like email@example.com) so that they won’t lose email messages when you update the NS records to point to Office 365.
Complete the setup wizard: Change your nameserver records
Sign in to Office 365 with your work or school account.
Choose Setup > Domains.
On the Manage Domains page, for the domain that you're setting up, choose Complete setup.
Follow the steps to update your nameserver records to point to the Office 365 nameservers.
After you’ve updated your NS records, email will begin to be routed to Office 365, but traffic to the website address that uses the domain will continue to go to your current hosting provider.