Search code examples
google-cloud-dns

Website Not working with www


I have a Server Running on Google Compute Engine with IP say xx.xx.xx.xx and I am using Google Cloud DNS to map my domain name say test.com to this IP address.

Here is what I did 1.) Created a Zone using UI and added a record set with Type A 2.) Gave my Domain Name provider NS Links 3.) Website is running beautifully when I type test.com, But it is not working when I type www.test.com

I tried creating CNAME (after watching for solution over Internet) but I got CNAME and A record set conflict error.

How do I solve this problem? (Preferably with UI without using gcloud tool)


Solution

  • You can duplicate the entry for the zone's root - e.g., copy the IP address, make a new RR set of type A at 'www', and paste the IP address.

    But the CNAME should work. What are you trying? Basically you want to create a CNAME at www that points to the root of the domain. You can't have anything else at that name, though (a CNAME says "use all the records from this other name) so you'll need to delete anything that's not a CNAME. Easiest to just delete the name and then recreate it as a CNAME.