Adding Custom MX Records for External Mail Servers

Stephen,

I understand that Custom MX records could be added when I want to use external mail servers to process email. But I would like to use the external servers instead of the default one’s in HSphere. I also know I would have to disable mail service on the Domain Settings page of the control panel in order to do this.

If mail service is disabled and the built-in MX record remains in the DNS zone, how would I go about manually removing it through the control panel? And if I did remove it and later wanted to bring back the default built-in MX records, is this possible and how would I do that?

Thanks!:smile:

Just add the custom MX record. That is enough. HSphere should then propagate that back to the nameserver.

I assume you know where it is in HSphere, but if not…
Domain Settings => Edit Controls (on Domain) => Edit Controls (on DNS Configuration)

On this page, it will show if there is a built-in MX record (with IP and name) – there shouldn’t be, but if for some reason one is there, just trashcan it, then add yours…

To get it back, just delete your custom one, and hit restore default mx…

fyi – that sucks about the client that jumped ship… Hope it is not too hard to move them back to their prior host for ya…

timruns,

Just add the custom MX record. That is enough. HSphere should then propagate that back to the nameserver.
Thanks for the info, but I already know how to setup Custom MX records in the DNS Zone.

My question was based on the notion that if you setup a Custom MX Record in the DNS Zone, it will allow you to have (2) Mail Servers, allowing you to set a priority for the one you want as the Primary Mail Server and less of a priority for the Secondary Mail Server. In this situation, the server creates (2) Mail Servers, (the built-in default) stays and the (Custom MX Record) is in addition to the default.

I am already aware that this is what occurs if you just simply setup a Custom MX Record. I am also aware that if you want to delete it later, you just click the trashcan next to it.

But, it is also possible to setup a Custom MX Record in the DNS Zone to use an External Mail Server instead of the built-in default Mail Server.

So, my original question was this: After setting up a Custom MX Record to use with an External Mail Server, How do I delete the built-in MX Record and if I delete it, could I later bring it back?

(FYI) I also know that you can disable the default mail server which will, in effect - delete all of the mail accounts, forwards, aliases, etc. However, I do not just want to disable it, I want to delete it!

Thanks!

fyi – that sucks about the client that jumped ship… Hope it is not too hard to move them back to their prior host for ya…
No, it would only involve giving them a copy of their website and changing the name servers. However, they have custom design functionality in their site that their old host can’t support. So they will have to pay someone to make the changes necessary for the move. I would have been happy to do it for them - but after the trouble they had with our mail server, they have decided to hire another company to do it. Our credibility went right down the toilet when the mail server went whacko!

I am now trying to figure out a way to add these Custom MX Records for future clients, so they can keep on using another mail server without the problems that ours has. That way, we can still host their sites, but they will no longer have to deal with spam and blacklists. Hopefully!:smiley:

Stephen,

I was hoping that you would see this thread because I really need an answer to this question ASAP!

I am trying to work with a potential client today who I may have to setup this way for their email to work correctly. I have to get back to them but I don’t want to do that until I know the answer to this question.

Can you help me?

My bad. I didn’t realize that HSphere would keep the default MX after you added the custom.

Could you change the MX record with the Registrar? I am trying to think back to the last time I modifed an MX, and it seems thats I did it at the Registrar level… I could, again, be wrong of course.

I would PM Stephen, if I were you, if you really need his reply…
Otherwise, you might create a ticket or repost this in a heavier trafficed forum (like reseller) to get people smarter than I am…

If I understand, correctly, you want only one MX record. To do this, turn off mail services for that domain. Then edit the DNS configuration for domain.com and insert an MX record there.

You can turn off mail services even after you create your new MX record so email is not lost

If I understand, correctly, you want only one MX record. To do this, turn off mail services for that domain. Then edit the DNS configuration for domain.com and insert an MX record there.

You can turn off mail services even after you create your new MX record so email is not lost

Thanks Yash!

I appreciate your answer. A couple more questions though! While I was waiting for a reply, I Googled my question and found some users talking about this very thing on psoft. Someone there mentioned that I would also have to add Custom A name records as well. Is this the case? I don’t think so, but that is what they were talking about.

Secondly, by doing what you state above, would that delete the built-in mail server or just cause it to become a secondary mail server? I would like to delete it if I could for my clients Domain since I don’t want ANY email going to the default mail server at any time.

Thanks!

turning off mail services would delete all email accounts on our server. Our system would not serve email for the clients.

Yes, you can also insert a custom A record by editing dns for domain.com. If you want to remove the original A record, you’d need to turn off web services

Thanks again Yash!

I just want to make sure though that it is not mandatory to change the A records in order to use an external mail server.

I only want to make sure that my clients’ external mail server would work for both POP and SMTP functions. So, I assume I would only have to make changes to the MX Records. Correct?

You do not need to do anything with the A records to host email externally.

Just change the MX record to the external mail server, and all emails will go to that mail server. POP3/SMTP functions would be a property of that external mail server, nothing to do with us

Thanks Yash!

I very much appreciate your timely and accurate reply! I will give it a shot!:slight_smile:

Sure you do need at least one A record that points to the external server! The client needs an address in order to access the server, and it is much better to give them a URL (not an IP address) so that you can make any changes in the future without involvingthem again.

My suggestion would be that you create an A record under your HOSTING domain name. something like:
[clientname]mail.hostingdomain.com
example:
joemail.cpncode.com

You might even want to set up two A records, for future flexability:
joemail-incoming.cpncode.com
joemail-outgoing.cpncode.com

Even though they would point to the same place for now, in the future, you may want to split them.

Then use joemail-incoming.cpncode.com (for example) in the client’s zone as the target of the new MX record, and also have the client use that as the name of the mail server that they use in their mail software (and joemail-outgoing.cpncode.com for SMTP).

As another suggestion, during the transition, i would simply add that MX record (at the highest priority) in the clients zone, before you turn off jodo’s mail service. That way you will be able to access both servers for a while, and pick up any straggling mail from Jodo’s server, or any that comes in during porpagation, and push it to the new server later.

After propagation and all is settled, then you can turn off mail services at Jodo.

OK – in order to keep one of my clients during this whole Comcast mess, I offered to move his mail service as well (to google apps).
So, my question is were you able to add the MX record without deleting the current mailboxes, so mail would not get rejected? I son’t want the client to lose any emails…
Thanks
Tim

timruns said:

OK – in order to keep one of my clients during this whole Comcast mess, I offered to move his mail service as well (to google apps).
So, my question is were you able to add the MX record without deleting the current mailboxes, so mail would not get rejected? I son’t want the client to lose any emails…
Thanks
Tim
Tim,

I set everything up on Friday. The propagation was completed as of this morning. Here is how I did it:

I setup (2) two custom MX Records. To do that, you go into the DNS configuration area for that zone (zone=your clients Domain). When setting up Custom MX Records, you do not have to type anything into the first space as it will default to that Domain when you save it. However under ‘Data’, you have to put a number in there. The lower the number, the higher the priority. So if your built-in MX records Data number is 10, then you would make the number for the Custom MX Record 5, as long as it is lower than 10. I used (1) just to be on the safe side.:slight_smile: Then for the target mail server, you put in mail.otherhost.com. I setup two Custom MX Records - one for mail.otherhost.com and another one for smtp.otherhost.com. They looked like this after I saved them:

(1) clientDomain.com IN MX 1 mail.otherhost.com

(2) clientDomain.com IN MX 1 smtp.otherhost.com

Once that is complete you can setup Custom CNAME Records. I again setup (2) two of them. Mine looked like this after I saved them:

(1) smtp.clientDomain.com 86400 IN CNAME smtp.otherhost.com

(2) mailserver.clientDomain.com 86400 IN CNAME mail.otherhost.com

The reason that my number (2) CNAME is “mailserver” as opposed to “mail”, is because the built-in CNAME already uses “mail” and you can’t have two at the same time.

Lastly, it is important to keep the mail service alive for that Domain until after propagation. Once the mail starts to be routed to the other server, you can forward any mail that is still in their accounts to the new server, then you can shut off mail service for that Domain.

jph posted today that you also have to setup new Custom A Records to make this work.?( I didn’t do that, but it seems to be working fine anyway. I just saw what jph wrote this morning and my propagation had already completed. I will have to look into what he is saying about that. I don’t know if you have to do that or not!

I hope this explanation helps you! Let me know if you have any trouble with it.:slight_smile:

you dont want an MX record pointing to

and you really shouldnt have 2 MX records at all unless you have two servers as a backup, and then the MX records should have different priorities.

and btw, the CNAMEs you set up serve the same purpose as the A records i was suggesting, just a different way to do it.

jph wrote:

you dont want an MX record pointing to
smtp.otherhost.com

and you really shouldnt have 2 MX records at all unless you have two servers as a backup, and then the MX records should have different priorities.

and btw, the CNAMEs you set up serve the same purpose as the A records i was suggesting, just a different way to do it.
jph,

Last week, on behalf of my client, I contacted thier ISP to find out how they wanted me to point to their mail server. They sent me an email with the exact configuration that I posted above in my response to Tim.

I wish that you would have been around here last week when I was asking Jodo how to do all of this. I believed I was doing it all correctly and when I checked dnsstuff.com this morning, it shows that all of my clients mail (incoming and outgoing) are all going to the new ISP’s servers!

Now I’m confused!?(

First, I don’t claim to be the ultimate expert on this stuff, but I have readup on it and been through it a few times.

An MX record serves only one purpose. It is there so that a foreign mail server trying to send mail to domain.com can find the appropriate mail server for INCOMING mail to domain.com.

If I am an SMTP server, i have the question “I have mail for [email protected], who wants it?” The answer is obtained by looking up the MX record for the domain… starting with the highest priority MX record found. If that address fails (theoretically) I should move on to the next priority MX record, until there are no more MX records to try, and then either give up, or try again later, depending on how I am configured.

If you have 2 MX records of the same priority, then theoretically other servers will choose randomly, so half the mail is attempted first at one of the servers, and half at the other.

It really makes no sense to have an MX record pointing to “SMTP.domain.com”, assuming that it really is an SMTP server, and not misnamed. In your setup there are basically two things that could be going on…

  1. smtp.otherhost.com is actually also a POP/incoming server (and in that case it is probably exactly the same server with the same IP as mail.otherhost.com).

  2. smtp.otherhost.com is not actually accepting incoming mail, and so roughly half of the mail sent to domain.com fails at least once by going to the wrong server, and then succeeds after some random number of additional tries. (These would not be failures that would create bounces or errors back to the user, but would be inefficient).

Either way, it may be working fine, but it is not really right. If smtp.oterhost.com is not accepting incoming mail, then you shouldn’t have it in an MX record at all.

If smtp.otherhost.com is the SAME server as mail.otherhost.com, then you definately should not have two MX records like that, because in the future SMTP.otherhost.com could very well be moved to some other IP, and at the very least, the two records are redundant (and not in a good way) and could only cause issues and confusion in the future.

Finally, if smtp.otherhost.com is actually a seperate server from mail.otherhost.com, but is set up as like a backup/relay for incoming mail to mail.otherhost.com, then yes, you could have an MX record for both, BUT smtp.otherserver.com should have a lower priority (bigger number) than mail.otherhost.com… that way when things are working normally, mail will go directly to te server where the client will be picking it up, and will only go to the backup when it needs to.