Setting MX records with Registrar vs. Nameserver Host

domain-name-systemmx-recordnameserver

I'm a bit confused about what has happened with one of my client's email accounts.

My client registered a domain at dotster.com. She wanted to start using email for that domain before we had her website up, so I set her up through Google Apps mail, and added the appropriate MX records to her dotster account.

When her website was ready, I hosted it on dreamhost and pointed to Dreamhost's nameservers for the domain in the dotster account. (e.g. Domain hosted at dotster pointed to Dreamhost nameservers for web hosting). MX records stayed the same as before, and everything worked fine for a while.

Today, she told me her email started bouncing. " error that the other server returned was: 554 554 5.7.1 : Recipient address rejected: Access denied (state 14)". When I did a traceroute, the MX records didn't show, but the text record did (also set at dotster).

So I went over to Dreamhost and added the MX records there. Now her email is working again.

My Questions:

1) Do the MX records have to be set at the place where the nameservers are pointed to? I thought they were independent.

2) I'm also pretty sure her email was working for a good amount of time after I pointed the nameservers to dreamhost. So why would it just suddenly stop working?

I am a front-end web designer/developer, so keep that in mind in terms of how much you assume I already know. 🙂 (Server-related stuff generally stumps me more than anything else).

Best Answer

1) Absolutely. When a DNS lookup is done (in this case, to see where to send mail), that lookup is done from the nameservers. So if your nameservers don't have the MX record listed, the lookup will result in nothing.

It's the same as a phone book--except imagine that you can only list your phone number in one phone book at a time. So you tell your friends "Look me up in the Acme phone book." So when they want to contact you, they look your phone number up in the Acme phone book, find your listing, and call you. But then if you move your listing to the "OtherGuys Phone Book", but don't tell OtherGuys what your phone number is, when your friends look you up in OtherGuys, they won't see your phone number--because it's listed in the Acme book instead.

2) This is because the nameserver records for your client domains were cached for a while (typically for several hours, possibly up to several days--the timeout is configurable). This means (roughly) that anyone who did an MX lookup prior to you switching nameservers, kept the old information in memory for a while, so they wouldn't have to look it up again. But eventually, that information expired, so when they tried to look the information up again--this time from the new server--they got "nothing", so the mail started bouncing.

Related Topic