Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from Jul 6 '12 at 1:01

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

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: MX 10 MX 20 A CNAME A A

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

share|improve this answer
This did the trick, thank you for your help. – Aaron Francis Jul 7 '12 at 15:21

Handling the redirect of can be done with a simple CNAME record. PHPFog directions should include the correct target for the CNAME. You won't be able to receive mail addressed to the www sub-domain.  IN  CNAME

Mail servers are located by an MX record. Mailgun should provide a name for the mail server to target. I've included SPF records which you may want to include. If they provide multiple host names add more MX records. Some servers don't support the SPF record type, in which case SPF will use the TXT record. IN  MX 10
                 TXT    'v=spf1 MX -all'
                 SPF    'v=spf1 MX -all'

Your domain does not need an IP address, and shouldn't have one unless you have a server with a static address. However, this means your web site will only be available using the www sub-domain. Some (most?) browsers will handle this for users who don't include the www. portion of the name. If you do have a server, it can run a lightweight web server which redirects all traffic to the www sub-domain.

You will also need NS records for your domain, but those should already be configured.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.