1

I'm using DNSimple for managing my records, hosting my site at Heroku and I want to use a Linux WHM (cPanel) for managing emails forwarding.

Hosting works, but I'm having a hard time getting emails to work. Here are my (pseudo-)records:

Type    Name                TTL    Points to
---------------------------------------------------------
ALIAS | mydomain.com      | 3600 | mydomain.herokuapp.com
CNAME | www.mydomain.com  | 3600 | mydomain.herokuapp.com
CNAME | mail.mydomain.com | 600  | <WHM server IP address>
MX    | mydomain.com      | 600  | <WHM server IP address>
NS    | mydomain.com      | 3600 | ns1.dnsimple.com
...   | ...               | ...  | ...
NS    | mydomain.com      | 3600 | ns4.dnsimple.com

There are two more records, SOA and TXT, generated by DNSimple, but I don't think those are relevant. When I add an A-record:

A | mydomain.com | 3600 | WHM server IP address

and change the mail CNAME and MX records to mydomain.com, emails start working, but then the hosting doesn't work anymore.

Is this possible to achieve?

silvenon
  • 113
  • 5

2 Answers2

0

You used a CNAME for the naked domain, which overrides any other record. I'm quite surprised DNSimple actually accepted this, since it's not really a workable configuration.

The naked domain should point to a server which does nothing but send a 301 redirect to www. which is pointed at Heroku.

See Why does Heroku warn against “naked” domain names? for the reasons why this situation exists.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • I'm not sure I understand. Are you referring to the ALIAS record? Should I use an URL record instead which redirects to the `www` record? – silvenon Jun 29 '13 at 00:15
  • 1
    Anyway, ALIAS is what DNSimple automatically creates when connecting to Heroku, so I think it's legit, because it's not CNAME. – silvenon Jun 29 '13 at 08:54
  • As @matija explained, he's not using a CNAME but an ALIAS, that is a special DNSimple feature that maps the rood domain to an A record. – Simone Carletti Jul 01 '13 at 08:14
  • Ohhh, that's almost as bad. "ALIAS" is certainly not a standard DNS record. – Michael Hampton Jul 02 '13 at 14:56
0
MX    | mydomain.com      | 600  | <WHM server IP address>

The MX record should point to a fully-qualified host name, not to an IP address. The same applies to a CNAME. In fact, it's quite common to create a mail.example.com hostname (either an A record pointing to the mail server IP or a CNAME that aliases an existing hostname pointing to the mail server IP) and point the MX record there.

You should check what is the IP of the mail server, create an mail.mydomain.com A record that points to that IP, then update the MX record with that hostname.

Simone Carletti
  • 1,494
  • 3
  • 15
  • 30
  • I added an A-record `A | mail.mydomain.com | 600 | `, then I removed that `mail.mydomain.com` CNAME record, and I directed my MX record to `mail.mydomain.com` instead of that IP address and it worked! I will mark this as correct once I'm certain everything works. – silvenon Jul 01 '13 at 11:23