Sat, 29 Mar 2008

Updating khan.org: Part 2, MX Records and updating Name Servers

For anyone who owns a domain, MX records are often key to your ability to receive email at your domain.

MX records, or Mail Exchanger records are used by mail servers across the Internet to identify what server is supposed to handle incoming mail for your domain.

Lacking an MX record, mail for "somebody@www.example.com" would be delivered to the "A record" or address record of www.example.com. That hostname may simply be a webserver, and there may be a desire to have a mail server on a different server. In addition, people often prefer to have their email be "somebody@example.com", and frequently enough, "example.com" doesn't have an A record.

Finally, what happens if you're restarting your "example.com" or "www.example.com" server? With just an A record, when that box is down, email sent to you will bounce.

Now there are load balancers and other advanced techniques companies can use to maintain high availability, but these techniques are unnecessary if you use MX records.

Specifically, you can specify a priority for MX servers. If MX server "a" is down, Internet email will just "automagically" work if you've defined a lower priority server "b" to take the load when "a" is down. This is because mail servers on the Internet will defer to a secondary if the primary is unreachable.

In my previous post, I mentioned DNS propagation, and mail is the most visible aspect of this principle. Using the technique I used, you'll see this in action. Having moved my domain registrar to register.com, and now with the ability to modify my DNS, I first had to tell register.com to "Restore Default DNS Server Settings".

This step changes the "NS" or NameServer records from pointing to the DNS servers on Richard's service, to those at register.com. But, don't do this step without being prepared to define all the other settings for your domain because any uncached requests won't find your domain because now all domain lookups will go to register.com, who doesn't have any of your domain's information yet!

Having "restored" the NS records to register.com, I could now add A and MX records for my domain. So I quickly defined my www.khan.org host to the IP address of my web host, and defined the MX records for my new mail hosting service. I also set it up (and this is optional) to use my old MX server at Richard's service as a low priority secondary in case there was something wrong with my new service.

A few tests from a few different mail service providers and doing nslookups/digs (utilities to look up DNS records) I confirmed that DNS was setup correctly and that the register.com settings were working.

I've glossed over the part about selecting and configuring "my new mail hosting service", but that'll be covered in part 3.




Khan Klatt

Khan Klatt's photo