Have a CNAME and an A-record for the same domain name

cname-recorddomain-name-systememailmx-record

I have a dedicated domain mydomain.com and I have a Windows Azure service that has to send email from addresses @mydomain.com. I found a mail service that agrees to send email "on behalf" of my domain.

That mail service requires me to add an MX-record for my domain and looks like MX-record implies a static IP address. Windows Azure doesn't guarantee static IPs at the moment and the industry-wide solution is to use CNAME records to map my domain name onto the third-level domain name in Azure (mydomain.cloudapp.net).

So ideally I'd want both an A-record and a CNAME for my domain. Is that possible? What are other options for my situation?

Best Answer

If you want to receive email you will want a static IP address for your mail server. In your case, I would have the mail service receive mail on your behalf as well. I would expect that the MX record would point to the provider's sever. Consider adding an SPF record indicating that the mail provider will be sending email for your domain.

If you are sending email to the Internet you do need an MX of some sort. Your email provider is correct in requiring you to setup an MX record. Your MX can point to their domain.

Consider mapping www.mydomain.com to the Azure service, if you have other services you can use the same subdomain, or additional subdomains. mydomain.com does not need to have an A record, but will need an MX record.

Having a CNAME record for mydomain.com eliminates the ability to have subdomains.

Try something like:

mydomain.com.     MX     10 mail.mailprovider.com
mydomain.com.     TXT    'v=spf1 mx -all"
www.mydomain.com. CNAME  mydomain.cloudapp.net