Changing Your Sites MX Record Published: Oct 12, 2005
  • Rating

    4/5

Change the MX record of your website HOWTO is an easy guide for modifying your MX record to direct mail from one mail server to another for Cpanel users.

Changing Your Sites MX Record

Change the MX record of your website HOWTO is an easy guide for modifying your MX record to direct mail from one mail server to another for Cpanel users. The MX record, short for mail exchange record, an MX Record is an entry in a domain name database that identifies the mail server that is responsible for handling e-mail for that domain name.

Basically you can have one server handle your website and another handle your email, such as Cpanel for the site and a Windows Exchange machine for mail if you want. You can also have multiple MX records so mail can go to more than one server and order them in priority by number, the lowest number will receive mail first but more on that later.

Requirements: Cpanel server with admin access

Cpanel MX Record - How to change your MX record

First off there are a few different ways to change your websites MX record. If you are not a server administrator then you have limits to doing this and may need to contact your system admin to have them set this up for you. As a regular Cpanel user you can only add one mx record and can't set any type of priority on it, secondly you cannot set a MX record as an IP address. You'll need to contact the admin once again. Otherwise go to Cpanel, Mail, MX record and enter the full domain of the server you want mail to go to and it will do the rest.


Advanced MX Changes - CHANGE TO IP ADDRESS


1)
Login to the server WHM as the root user.

2) Go to DNS Functions and Edit DNS Zone 
Edit DNS Zone

3) Select the domain you want to edit, or type it in, and click on Edit.

4) You should see the following, or something very close to it:

Edit DNS Zone MX

5) Now the MX has a priority of 0 meaning its the only MX entry used for the domain. Replace the domainame.com. with mail.domainame.com.

6) Now change mail from CNAME to A record and take out the domain, and replace it with the IP address.

WHM edit dns mx

7) Save the changes. Bind will reload, if it shows any errors then you did something wrong, make sure the MX entry has a . after it!

8) Login to your server by shell as the root user. Edit the /etc/localdomains file
pico /etc/localdomains  then ctrl+w to and type in the domain you modified.
Delete the entry for the domain.
Save the changes to the file, ctrl+x then Y

9) Edit the /etc/remotedomains file - this tells Exim to not handle mail for this domain.
pico /etc/remotedomains
Add the domain name to this file.
Save the changes.

10) Your now done! Make sure you dns is updated, in shell run:
host -t mx domainname.com

You should see mail.domainname.com

  • Rating

    4/5

Related Articles

Comments (8)

  • Gravatar - abubin
    abubin 06:36, October 26, 2005
    Do I need to be running own DNS server for this to work?<br />
    <br />
    What if I am using DNS server from my webhost?
  • Gravatar - joel
    joel 06:14, February 6, 2006
    what daemon will handle the mail if not exim? I still want to see the message queue in WHM
  • Gravatar - joel
    joel 07:06, February 6, 2006
    Will this not work if exim is allowed to continue to handle email? Steps 8 and 9 are too risky for me - and step 10 is already correct. Help?
  • Gravatar - JC John SESE Cuneta
    JC John SESE Cuneta 09:25, August 11, 2006
    @joel, I'm not an expert in this, but as far as I'm concerned, my server setting is working properly without doing Steps #8 and 9.<br />
    <br />
    If I understood it correctly, doing those two steps will keep your server from reprocessing your old local mail.yourdomain.tld setup. So next time for example, EXIM rechecks itself, it won't run again for the domain mail you changed.<br />
    <br />
    ^^<br />
    <br />
  • Gravatar - Alex
    Alex 08:24, May 2, 2007
    I changed MX record to rs511.securehostserver.com. now when sending test email it bounces back? Technical details of permanent failure: 553 sorry, mailbox unavailable (#4.7.1) ** Please confirm if this is normal?
  • Gravatar - pritpal singh
    pritpal singh 11:32, March 13, 2009
    sir,<br />
    Very much thanks.... for your help to me in changing mx record properly..... thanks for your service to the community...<br />
    you done a great job<br />
    pritpal...
  • Gravatar - RealGroup
    RealGroup 14:46, March 21, 2009
    Good, Really good information. The screen shots takes to the perfect steps. <br />
    Thank You Very Much.<br />
    :)
  • Gravatar - theh1982
    theh1982 11:23, August 6, 2009
    This video tutorial helped me a lot <br />
    http://www.youtube.com/watch?v=HZfehwUAROU<br />
    <br />
    <br />

Add Your Thoughts

WebHostGear.com is a hosting directory, not a web host.

Copyright © 1998-2024 WebHostGear.com