MX Backup (or how to backup your own domain email for free)
April 23rd, 2005
OK, so you’ve become a proud owner of an internet domain. You’ve built your website and also setup the email service so that you can send and receive messages from/to [you]@[yourdomain]. You’re all excited and everything seems to be perfect. That is, until people start telling you the email they sent you bounced back, or even worse, start asking why haven’t you replied to that important message they’ve sent. Well, you never recieved it. So you start scratching your head…
This post will explain what is happening in the background and how to fix the problem (for free). Don’t be discouraged by the length of the post, the process is quite simple.
When you setup your domain email you generally either forward it to another email address (FastMail, GMail, Yahoo, your ISP, etc), or you decide to take full control and go for the more advanced solution - host your own email, either at your webhost or on your own home machine. I’ll leave the forwarding case for another post and discuss the hosting solution here. So, the main question is, what happens when your mail server (or webhost) is down?
Very simplified, when someone sends an email to [you]@[yourdomain], the sending server checks the MX (Mail Exchange) DNS records for [yourdomain]. This record tells the sender where the email for [yourdomain] should be sent to. It gets the first one, resolves its IP address and tries to send the email to that server. All is fine if the server is up. Sometimes however, your server will be down for maintenance or other reasons and the sending server will either store the message and try again later or just discard the message completely. Huh, not exactly what you wanted!. So, how do you prevent this?
The first thing you should do is generate a report on DNS Report. Enter your domain name and click the “DNS Report” button. You will be presented with some useful information about your domain. Search for the “MX Record” field. How many MX records are defined? Only one? Read on.
If you have only one MX record defined, if the server that that record is pointing to is down, the sending server might try sending the message again later or might discard the message completely. To ensure that the email reaches you, you have to add backup MX records which will point to mail servers that will take over in case the primary MX server is down. In this case, if your primary mail server is down, the sending server will try to send the message to the backup servers instead.
You can define as many MX records as you want and prioritize them by assigning them numbers (lower numbers having higher priority), thus completely eliminating lost messages due to the “mail server down” problem. 3 MX records pointing to reliable servers in different locations is generally a good enough solution.
Once people are aware of this problem, the first question they ask is “Where do I define MX records?“. This usually depends on your domain registrar (that’s where you bought your domain). I buy my domains from Namecheap which provides an easy to use control panel where I can define all my domain records. Other registrars usually also allow you to setup MX records. Ask their support if you can’t find it. In brief, you set your MX records wherever your DNS is being hosted. This is usually your registrar (if you don’t have a clue, this is where it probably is), but could also be your webhost or an external service such as ZoneEdit.
The second question is “Where do I point my MX records to?“. Well, there are a bunch of services on the net that offer MX backup (try googling for that term). However, these services are quite overpriced for their purpose, since they are mainly targeted at small businesses. Remember, the backup server will only jump in when your main mail server is down. What I used to do until recently was buy a very cheap (~ $5/year) web hosting account which I used for MX backup only. However, I discovered Rollernet which offers MX backup for free (you have to register), evaluated it for a few months (very reliable!) and I’m now using it as my primary MX backup solution for my domains, with the exception of my most important domain which is hosted (and MX backed up) with FastMail. Rollernet provides a great feature - logging, which allows you to check what messages have passed through it and when. It is interesting that sometimes, even though SiteUptime doesn’t notice any “down” periods for my webhost, some messages are still being routed through the backup mail server (main mail server down). This service is provided free of charge, but consider donating, the guy behind it is doing a fantastic job and really deserves it.
As an example, MX records for one of my domains are defined like this:
IN MX 5 mail.example.com.
IN MX 15 mail.rollernet.us.
IN MX 15 mail2.rollernet.us.
This means that if mail.example.com is down, the mail will be routed to one of the MX 15 servers. The messages are stored there until your primary mail server is up. At that time the queued mail will be forwarded from the backup server to the primary one.
That’s it. Once you setup your two MX backup servers on rollernet.us, perform a new DNS report on your domain. You shouldn’t see a red boxed warning for MX records anymore. You can relax. All the mail that has been sent to you will reach you. That is, if your DNS is properly backed up. More on that some other time.
If you are interested in getting deeper into the subject of configuring your own perfect domain email backup, check out this great thread on EmailDiscussions.com. It is full of useful thoughts, approaches and concerns on MX and domain email backup in general, discussed by people who don’t tolerate losing one single mail (myself being one of them ).