0

test.com DNS to cloudflare and I configured the www A record to point to google firebase. all good here.

I want to point any domain to www.test.com and render exactly the same content. what should I do to achieve this? do I need to create my own DNS in cloudflare and give it to domain admins so they can configure the domain? any pointers will help. thanks!

handsome
  • 2,335
  • 7
  • 45
  • 73

1 Answers1

3

Providers like Firebase Hosting use the Host header name of the incoming request to determine which customer's content to serve. If other people change their DNS to point to www.test.com, the Host header will still be populated based on the domain they provided.

To make a website serve the same content regardless of domain, you need to either:

  1. Host the content on a dedicated IP address such that the Host header doesn't matter (this is not possible with Firebase Hosting) or
  2. Have all connecting domains proxy to www.test.com as opposed to directly setting DNS and include a Host header of www.test.com when they forward traffic.

In general services where you need to manually configure a custom domain (e.g. Firebase Hosting, Heroku, etc) are not going to support arbitrary other domains pointing to them without an additional layer in between.

Michael Bleigh
  • 25,334
  • 2
  • 79
  • 85
  • so do you think that 2. is possible? I don't want to "fully" host the domain I only need it to serve exactly the same content my firebase hosted domain is served (and then will use javascript to check the url and do something else) not sure how to do. the proxy. but that seems to be a good way to achieve this. (checked with fiebase support and they dont support it so I need to build something around it) – handsome Jul 01 '20 at 18:22