Error setting up MX + CNAME to setup Hubspot for email on subdomain

0

Per my research DNS rules don't allow you to setup a CNAME and MX records on a subdomain. I already have a route53 hosted zone for my subdomain such as - email.company.com. Now I need to setup that subdomain to both receive email (via google workspace, which requires MX records) and email html pages (via hubspot that requires a cname record).

How can I do this? What is the appropriate workaround? This must be a pretty common use case, so I can't figure out why it's not possible. I know on Hubspot if you set it up to add your primary domain then they require an A record instead of a CNAME, but they don't allow this for subdomains for some reason, they only provide a cname option.

Thanks

sip49
asked 4 months ago271 views
5 Answers
0

I get that part, but in the subdomain hosted zone, you can't have a CNAME and MX record. I have the subdomain hosted zone working fine with the NS records setup in the parent domain.

But my question now, is how can I have a CNAME record for mail.company.com that points to the hubspot provided domain AND MX records for mail.company.com that point to the gmail servers? Route53 gives me this error: "Bad request. (InvalidChangeBatch 400: RRSet of type CNAME with DNS name mail.company.com. is not permitted at apex in zone mail.company.com.)

sip49
answered 4 months ago
  • Hi sip49,

    Can you provide even with dummy domain name and subdomain what exactly you want to achivie? Domand and Subdomain and records what do you need in each of them. It will be easier to help.

    Thanks,

  • Sure. Appreciate all the help in advance.

    I have 2 hosted zones in Route53:

    • company.com
    • mail.company.com Both are working properly with additional DNS records in each.

    Now for mail.company.com I want to set it up to enable 2 things: (1) gmail as an alias domain to the root domain, so users can receive emails at <user>@mail.company.com and (2) hubspot domain setup which they use to track links in email and provide HTML versions of emails at the same mail.company.com domain.

    For #1, GMAIL provides MX records that must go into the mail.company.com hosted zone. They look like:

    • MX mail.company.com <google mail domains> --> this is setup and works properly. We can now send + receive email from <user>@mail.company.com including via Hubspot

    For #2, since it's a subdomain, Hubspot provides a CNAME record that must be added. They provide a record that looks like: CNAME mail.company.com <hubspot.com url>

    In this case, I can't get a way to get the CNAME above in at either hosted zone. Is that the level of detail you were requesting?

0

Here are the hubspot add domain instructions: https://knowledge.hubspot.com/domains-and-urls/connect-a-domain-to-hubspot

The main issue is they only provide A records if you are connecting a root domain. I have no idea why, but that is what they say and when I try to add the domain it only gives me cname record to update without an A record option. You'll see their warning in the 5th bullet of the page above.

sip49
answered 4 months ago
  • Thanks I’ll have a read.

0

Hubspots documentation says www.Blah.com is a subdomain. Some people call it a subdomain when it’s just a CNAME record in the root domain. I call a subdomain a full blown domain in its own zone like you’ve setup.

What I would do is any where it says Domain/root domain use your subdomain eg mail.company.com

If you had www.mail.company.com the. Treat that as a subdomain but create a CNAME in mail.company.com

I’ve a feeling that would work for you. I think their documentation is missing some points. See how you get on.

profile picture
EXPERT
answered 4 months ago
  • Good idea. I tried, but of course Hubspot won't even let you type in "mail.company.com" in the root domain field. :facepalm: Looks like due to dumb hubspot limitations this may not be possible.

0

Subdomains is possible. This is natively how DNS works.

If you have setup a subdomain zone in route 53. Then create the NS records in the parent domain to point to the name servers in the sub domain.

Then just create the MX record etc in the sub domain zone.

.com is a domain and your domain company is a subdomain of .com. mail.company.com works in the exact same fashion.

profile picture
EXPERT
answered 4 months ago
0

In DNS it’s impossible to have a CNAME in the APEX of a domain. It has to be an A record. AWS have support for aliases in route53.

You can have a cname for www.mail.company.com without an issue.

https://kb.isc.org/docs/aa-01640

MX records in subdomains are fine. It’s your CNAME in the APEX which isn’t supported I’m afraid.

Do you have a link to hubspot of what your trying to do?

profile picture
EXPERT
answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions