DNS – How to Configure DNS to Point Main Domain at Firebase Hosting, Not Subdomain

domain-name-system

I currently have a website hosting on CPanel which consists of subdomain.example.com and example.com. I'd like to keep the subdomain hosted where it is, but move the main domain to be hosted with Firebase. I'm struggling to work out the required DNS changes to make this work.

If it is relevant, the domain was purchased from 123-reg and points to custom nameservers on my CPanel server.

I read this answer, but I've also read that Firebase no longer allows CNAME records and has to be A records.

Would it work to have an A record pointing to the IP addresses supplied by Firebase and a CNAME record for the subdomain pointing to the server where it is currently hosted?

Best Answer

You need to create two A records:

  • domain.com -> Public IP address of your first server
  • sub.domain.com - Public IP address of your second server