Email Sending Domain Setup

A step-by-step walkthrough on how to purchase and setup your sending domain with Cloudflare and OneSignal.

To configure email with OneSignal, you must own the sending domain. This guide will show you how to buy a domain and set up the required DNS records to send emails via OneSignal.

πŸ“˜

Do you already own a domain?

If you already own the email sending domain, then you just need to setup the DNS records provided by OneSignal. Follow the DNS Configuration Steps Guide

The following guides use Cloudflare as an example. Please use your desired DNS provider.

Register Your Domain

Example registering your domain with Cloudflare (click to expand)

Create an account at Cloudflare.com

Navigate to Domain Registration > Register Domains and search for the desired domain name.

In this example, we'll be registering the domain onesignaldemo.com.

Choose the desired domain and select Purchase. If the domain you entered is not available, you will have the option to choose a similar domain name.

Once you have purchased the domain you should see it as active under Domain Registration > Managed Domains.

Create Subdomain

It is recommended to use a subdomain for sending email.

How-to setup a subdomain with Cloudflare (click to expand)

To create the subdomain add an "A" record to your DNS Management page.

  • Click add record.
  • Select Type "A".
  • Add the subdomain to the "name" field. In this example, the subdomain is mail. Cloudflare will automatically append your domain to create the subdomain. In this example it'smail.onesignaldemo.com.
  • To set the IPv4, use NSlookup on one of the Nameserver subdomains domains.

Once you have the IPs for the "A" record add one of them to the IPv4 address field and hit "Save".

Get IPv4 from the Nameserver

Skip this step if you already added the IPv4 to your subdomain.

Getting IPv4 from Nameservers in Cloudflare (click to expand)

Go to DNS > Records and copy one of the Nameservers (demi.ns.cloudflare.com) and paste it into the search bar on nslookup and click "Search DNS".

Copy demi.ns.cloudflare.com Namerserver

Copy demi.ns.cloudflare.com Namerserver

Search demi.ns.cloudflare.com Nameserver

Search demi.ns.cloudflare.com Nameserver

Select one of the IPs to set in your Subdomain IPv4 field.

Copy and paste one of the IPv4 addresses add it to the IPv4 field in your "A" record and hit save.

DNS Authentication Steps

Requirements

Below are links to how-to guides for some of the most popular DNS providers. Please note that these guides are written by the domain providers and are not maintained by OneSignal.

DNS How-to guides by provider (click to expand)
Domain ProviderDocumentation Links
GoDaddyMX, CNAME, TXT
NamecheapDNS Questions
HostingerHow to Manage DNS Records at Hostinger
Network SolutionsHow do I manage DNS and advanced DNS records?
RackspaceMX, CNAME
HostGatorMX, CNAME
GoogleMX, CNAME
CloudflareManage DNS Records
DNS Made EasyMX, CNAME, TXT
DreamhostAdding custom DNS records
Dyn (Oracle DNS)Set up DNS
HoverManaging DNS records
Amazon Route 53Working with records

Continue through the documentation to finish adding OneSignal to your app.

Adding DNS Records To Your Domains DNS Management Settings

This guide will be using Cloudflare as the domain provider and setting up the subdomainmail.onesignaldemo.com.

If you have not done so already, follow the Email Quickstart guide to setup OneSignal Email configuration, then return back to this page.

Next, add the DNS records to the DNS provider.

Add the CNAME Records

In Cloudflare, navigate to DNS > Records.

  • Select the Type "CNAME".
  • Copy/Paste the hostname shown in OneSignal to the "Name" field in the DNS provider.
  • Copy/Paste the Value in OneSignal to the "Target".
  • Turn off Proxy Status to DNS only.

Add the MX Records

  • Select Type "MX".
  • Copy/Paste the Hostname from OneSignal into the "Name" Field for the MX record.
  • Copy/Paste the Value from OneSignal into the MX server field.
  • Set TTL to Auto or lowest value.
  • Priority to 10, click "Save".

Add the Remaining Records

Continue the process to add the remaining DNS records. After adding all DNS records to your Domain Provider, check OneSignal to see if the records have been verified.

Check DNS Record Verification

Go back to the Email Configuration and click "Check Records" You'll see green check marks when a record has been verified and a prompt that your DNS records have been authenticated.

Authenticating DMARC

🚧

Google requires that your domain has DMARC authentication set up to ensure email security for bulk sending. Please take the necessary steps to implement DMARC for your domain. Email Sender Guidelines

Setting up DMARC for your subdomain is a proactive measure to improve email security, build trust with your audience, and maintain your brand's integrity. See our What Is DNS Authentication to learn more.

DMARC Policy

In DMARC (Domain-based Message Authentication, Reporting, and Conformance), the "p" (policy) tag is used to specify how email receivers should handle messages that fail DMARC authentication. The "p" tag can have various values to set different policies. Here's how you can set the "p" tag:

"p=none" (Monitoring Mode):

This is the most permissive option. It instructs email receivers to not take any action against email messages that fail DMARC authentication.
It is commonly used when initially implementing DMARC to gather reports on email authentication failures without impacting email delivery.

"p=quarantine" (Quarantine Mode):

In this mode, email receivers may choose to treat emails that fail DMARC authentication as suspicious. Some receivers may quarantine these emails, which means they might be delivered to the recipient's spam or quarantine folder.
It is a middle-ground option, providing some protection against phishing and spoofing while allowing for email delivery.

"p=reject" (Reject Mode):

This is the strictest policy setting. Email receivers should reject or discard email messages that fail DMARC authentication, preventing them from reaching the recipient's inbox.
It provides the highest level of protection against phishing and email spoofing but should be used with caution to avoid blocking legitimate emails.

DMARC Setup

In the example, we will be setting the DMARC policy to p=none. You will have the option to change/update the DMARC record to follow a more secure policy.

  • Add a new record.

  • Set the record type to TXT.

  • Add _dmarc.yourdomain.com to the "name" field.

  • Set TTL to Auto.

  • Add the following value within the content field but replace the domains with your own.

      v=DMARC1; p=none;
    
  • Click "Save".

πŸ‘

Done! Continue to Email Quickstart.

Next steps are to setup your default sender settings, import emails, and verify your account.

See the next steps in the OneSignal Email Quickstart to finish the setup.