1. Knowledge Base
  2. >
  3. Results
  4. >
  5. How to Set Up Your MX (Mail Exchange) Record

How to Set Up Your MX (Mail Exchange) Record

The Mail Exchange record or MX record specifies the mail server responsible for sending and receiving your emails. They basically tell your host where to deliver your emails. Depending on your email host, MX records may vary. Some may have multiple MX records, like Google Workspace, and some may only have one, like HostGator.

This article discusses how to set up your MX records with HostGator as your email host.

Are you looking into hosting your emails with another hosting provider? If yes, please visit our support guide, How Do I Change My Website's MX Record? for more details.

Here are the topics we will discuss in this article.

How to set up MX records

Scenario 1: I am using HostGator's name servers

If your email domain uses HostGator's name servers, you can manage your DNS records within your control panel. For this scenario, you need to:

Step 1: To set up your MX records: 

  1. Log in to cPanel.
  2. In the Domains section, click Zone Editor.

    cPanel - Zone Editor

  3. Locate your email's domain, then click on Manage.

    cPanel - Zone Editor

  4. Look for HostGator's MX record, 'mail.example.com' ('example.com' is your actual email domain name), through the list of zone files.

    MX records

    • If 'mail.example.com' is not yet in this section, click + Add Record and select MX from the dropdown. Fill out the necessary fields.

      add record

      Priority: 0
      Destination: mail.example.com (Please replace 'example.com' with your actual domain name)
      What would happen if two MX Records had the same priority?
      The lowest-numbered priority is the most preferred. If two MX records had the same priority, the SMTP Sending Server would select one at random when delivering emails.

      To avoid confusion in the MX records, you can delete other MX records other than 'mail.example.com' by clicking the Remove link from the Actions column.
  5. Once the MX records are set up, check the DNS zone files if the A records for 'mail.example.com' exist.

    A Record for your Mail

    • If there is an existing A record for 'mail.example.com' with the correct HostGator Shared IP, there is no need to change or add a new one. If you wish to check if 'mail.example.com' uses the correct Shared IP, please click the expand below.
      How to identify your Shared IP

      To locate your Shared IP address:

      1. On the cPanel homepage, locate the General Information section on the right-hand side.
      2. This section will display your server information, including your Shared IP address.

        cPanel - Shared IP Address

    • If there is no existing A record for 'mail.example.com,' add a new A record using your cPanel's Shared IP address.
      How to add an A record

      To add a new A record:

      1. On the cPanel homepage, click Zone Editor.

        cPanel - Zone Editor

      2. Locate your email's domain, then click on its +A Record button.
        +A records
      3. In the Add an A Record section, enter the necessary details.

        cPanel - Add A record
        Name: mail.example.com (Please replace 'example.com' with your actual domain name)
        Address: Your cPanel Shared IP address

      4. Click the Add An A Record button.

Step 2: To set up local email routing:

  1. Navigate back to the cPanel homepage.
  2. In the Email section, click Email Routing.

    HostGator cPanel MX Entry

  3. Select your domain from the dropdown menu. For this scenario, select Local Mail Exchanger.

    cPanel - Email Routing

    This section will show several email deliverability methods. For more information on each of these methods, please see Local, Backup, and Remote Mail Exchanger.

Congratulations! Your email is now hosted by your HostGator account.

Scenario 2: I am NOT using HostGator's name servers

If your domain name is not using HostGator's name servers, but you wish to host your emails with HostGator, you will need to update your MX records at the hosting company where your name servers are or at your domain's registrar.
Why? Any change in the DNS records will only take effect if it is updated through the name servers' hosting company or domain's registrar.

Depending on your remote host or registrar, you can use HostGator's MX record, 'mail.example.com' (replace 'example.com' with your actual domain name), or HostGator's Shared IP address to connect your emails.

To connect your emails to HostGator via remote hosting provider:

  1. Find your HostGator Shared IP address. See instructions on how to find your Shared IP above.
  2. Create an A record for your emails within your hosting provider's control panel. Use your HostGator Shared IP address as your A record.
  3. Once you have the mail's A record created, modify your MX record and email routing at your remote hosting provider.
  4. If additional assistance is needed to update the current MX record, mail's A record, and email routing, don't hesitate to get in touch with your hosting provider or registrar's support team.

Additional information

Here is a list of terminologies related to setting up emails that you may encounter in other supporting articles.

Name ServersThis is the server that hosts your DNS zone files. For more details, check out the article: What Are My Name Servers?

Example: ns1234.hostgator.com and  ns5678.hostgator.com.
Email HostThis is the service provider that hosts or handles your emails on their servers. 
Domain PointingThe process of setting up the server where you wish to host a service like your website or emails.
Email RoutingThis setting tells HostGator how to handle your emails, whether hosted locally (by HostGator) or remotely (by a different host). Please refer to the article, Local, Backup, and Remote Mail Exchanger, for more information.
MX RecordsThese are the DNS records responsible for handling your emails.
Example: mail.example.com
Shared IP (formerly Site IP)This is the IP address found in your Customer Portal and control panel.

To check your domain name's current name servers and MX records, you can use these online tools:


Below are some examples of commonly used MX records:

ProviderMX Record Value


Reference: MX Entry

Google Workspace

(Formerly G Suite)


Reference: Google Workspace MX record values

Microsoft 365


Reference: Add DNS records to connect your domain

Note: Replace 'example.com' with your actual domain name.

Have further questions? Please contact us via phone or Live Chat so we can assist you!