DNS Help (CNAMEs and A Records)

cname-recorddomain-name-system

I'm trying to set up my DNS properly so that I can have hosting through PHPFog and email services using MailGun. PHPFog has us redirect the naked domain to the www and then use a CNAME to point the www to PHPFog and mailgun provides the MX records to use. The problem I'm having is that I have no A record set up on Hover because when I do, the CNAME no longer works (?), or at least it seems that way because I am no longer seeing my site from PHPFog, I'm seeing a Hover landing page. I know all the records I need, I just can't seem to get them to play nicely together. I've been told Amazon's Route 53 should be able to solve my problem, but I haven't yet figured out how. I just need to have hosting at PHPFog and email services through MailGun.

As you can probably tell, I have only a very limited understanding of DNS, so forgive me if this is a silly question.

Best Answer

You cannot mix a CNAME and any other "common" record for the same name. That's by specification. Wikipedia will tell you more about the CNAME restrictions.

You solution here would probably look like:

example.com. MX 10 smtp1.example.com.
example.com. MX 20 smtp2.example.com.
example.com. A 4.3.2.1
www.example.com. CNAME example.com.
smtp1.example.com. A 1.2.3.4
smtp2.example.com. A 5.6.7.8

Where 1.2.3.4 is the IP address for your mail delivery server, smtp2 of IP 5.6.7.8 is a hypothetical backup mail delivery server (get one, get rid of the associated 2 lines if you don't care), 4.3.2.1 is the IP for your web server.

Related Topic