Create a Mail Exchange (MX) record
Most people use email with their domains. To use email, we need a Mail Exchange (MX) record so any domain email is sent to the right place (whether that is a mail server on the slice or an external mail provider).
Let's set that up now.
Simple
The example in this article is a very simple one. I will do a separate article on setting up MX records for Google Apps.
The procedure shown below uses a subdomain called 'mail' and the MX record points to that subdomain.
If you use an external mail agency (such as fusemail or fastmail), then leave out the A-record creation and point the MX record as directed by your provider.
DNS Panel
So, log into the SliceManager at https://manage.slicehost.com and navigate to the DNS tab:
Now click on the 'records' link next to your domain.
If you haven't created a zone for your domain, then refer to this article.
Base Records
You should already have the base records shown here:
Click on the 'new record' link.
A Record
Firstly we need to create a subdomain A Record called 'mail'. The MX record will be directed there.
Again, if you are using an external mail agency, then skip this step. This is only for those who plan on running a mail server on their Slice.
In the fields I entered:
Name: mail
Data: 208.75.84.20
Done. The subdomain record is now complete.
MX Record
Next we need to set an MX Record. Again, click 'new record' and select MX Record from the 'type' drop down box:
In the fields I entered:
Name: mynewdomain.com. (Note the trailing period '.')
Data: mail.mynewdomain.com. (Note the trailing period '.')
Auxiliary Info: 0
Unless you have specific requirements to change the Auxiliary Info, leave it at 0.
If you use an external mail agency, they may suggest other values, in which case, follow their advice.
Dig
Cool. Now we only need to wait for the DNS records to propagate.
However, it would be nice to check the records are correct and we haven't made a typo somewhere.
No problem, we can use the 'dig' command (see the introduction to dig article for more info),
So a simple query of the DNS servers for our MX record would be:
dig @ns1.slicehost.net mynewdomain.com MX
The 'question' and 'answer' part of the output is as follows:
;; QUESTION SECTION:
;mynewdomain.com. IN MX
;; ANSWER SECTION:
mynewdomain.com. 86400 IN MX 0 mail.mynewdomain.com.
Nice. All the values are as expected.
Summary
We've gone into some detail here but setting MX records for your domain is nice and straight forward using the SliceManager.
Once you have set a record, it is always a good idea to check the values with a simple 'dig' command.
PickledOnion.


Article Comments:
Stephen commented Thu Jan 10 17:39:06 UTC 2008 ago:
I can't seem to get my email hosted by godaddy to work. I was pointed in the direction of this article and was wondering if you could clarify what I need my settings to be in my MX records to make this work!?
When setting up an email account, you may receive the "pending setup: validating MX record" while the system verifies your email account is using the correct MX records. If the MX records are correct, the message disappears. If the message remains, the MX records you specified in your hosting provider or domain name system manager may be incorrect. Your hosting provider is where your domain is hosted; your domain name system manager is a third-party domain manager where you might manage your domain settings, such as your DNS servers or MX records.
If the MX records are incorrect, you can add the correct MX records in your hosting provider or third-party domain name system manager. To Change the MX Record
comb commented Thu Jan 31 03:17:36 UTC 2008 ago:
http://www.destr0yr.com/article.php/GmailandsSMTP
I was a bit lost on getting my system emails (cron, php generated, etc) off the box if they were addressed to the same domain. Mail to/from other domains were fine.
Anyway, EpochWolf in IRC showed me this nice easy solution: ssmtp. Perhaps a mention in your googleapps and mail related articles.
For us noobies :)
Jeff commented Sat Feb 23 02:56:39 UTC 2008 ago:
Hi. The first bit of advice is exactly what GoDaddy told me today 2/22/2008....but for the life of me, I can't understand where, here at SliceHost, you find the fields * MX 0 and MX 10. Can I buy a clue from someone?
Michael commented Sun Feb 24 20:40:36 UTC 2008 ago:
I too, struggled for about half an hour before I finally got mail services working with my email at another provider. The 10, 0, etc. are just priority numbers. Those numbers go in the Extra/Auxiliary data field. One problem I had, was getting the IP address right. While A and CNAME just take straight IP addresses in form of "192.168.0.1", MX records require a period at the end of the IP address as "192.168.0.1." otherwise it gets expanded on as 192.168.0.1.yourdomain.com, which obviously isn't correct.
Michael commented Sun Feb 24 20:45:06 UTC 2008 ago:
Also, I'm not 100% sure, I believe the "" is equivalent to "yourdomain.com." (with ending period) in the first field for slicehost's interface. Some sites use "none" or "@" while others seem to use "" to indicate, there's no leading value pre-pended to your domain name.
Stéphane Bortzmeyer commented Tue Feb 26 13:51:19 UTC 2008 ago:
No, Michael, do not put an IP address in the right-hand side of a MX record. It is not allowed by the standard and it will break with some software.
Use a host name on the right hand side.