2

I'd like to have the naked domain and the www point to the same service

While the naked domain mapping works as expected, the www mapping ends up with an error, saying that the mapping already exists

enter image description here

Is that normal ? What should be done to have it correctly handled by cloud run ? can two domains point to the same service ?

Ben
  • 5,030
  • 6
  • 53
  • 94
  • Cloud Run supports multiple domain mappings (e.g. `example.com`, `www.example.com`, and `anything.example.com` at the same time). Update your questions with details on your Custom Domains for your Cloud Run Service and your DNS server settings. For security, mask your domain names by using `example.com` as the root when updating your question. – John Hanley Aug 07 '19 at 16:22
  • @JohnHanley thx for your comment; is this update okay ? – Ben Aug 07 '19 at 16:41
  • The ping part is not needed - that only tests if Google's service endpoint is running and does not test your Cloud Run service. Please add the Resource Record settings that you created in your DNS server. The DNS Resource Records must match the DNS settings that Cloud Run requires (shows you in Custom Domains). – John Hanley Aug 07 '19 at 16:46
  • thx again. if i ping my domain (we'll call it www.example.com here), doesn't it shows that this domain it pointing to the correct endpoint / correctly configured ? I've updated with the dns conf above – Ben Aug 07 '19 at 16:56
  • From your ping portion, I see a different IP address returned. This means that you had this service mapped to another address. You will have to wait for the DNS cache to flush (TTL) if this is the case. – John Hanley Aug 07 '19 at 16:56
  • are you in the same region ? – Ben Aug 07 '19 at 16:58
  • You can use an Internet service to verify your settings. I use MxToolbox. They have a number of tools that work well if you know how to read the records: https://mxtoolbox.com/DNSLookup.aspx – John Hanley Aug 07 '19 at 16:58
  • ok i'm sure of the settings; it works for any other given domains **using a subdomain**. once i try to mix both subdomain/naked, it screws the subdomains. so my initial question. do you have this compared (2 domains -> one service, naked/www) setup running ? – Ben Aug 07 '19 at 17:00
  • 1
    Please read my first comment again. This is supported and yes I have done this dozens/hundreds of times - however the service is in BETA so a Google change could have happened this morning that broke something for example. My guess is that you have made several changes. Now you will have to wait for DNS TTL for the previous entries to expire. Use the tools that I recommended to debug what is wrong with your DNS setup. – John Hanley Aug 07 '19 at 17:03
  • I have several production Cloud Run services that use both example.com and www.example.com. I just verified that they are working correctly. – John Hanley Aug 07 '19 at 17:06
  • thx a lot for those explanations. I've posted the last message i've got; it ends up with this error – Ben Aug 07 '19 at 21:27
  • My suggestion is to delete all Domain Mappings for this Cloud Run service and the corresponding DNS entries. What an hour and then create them again after the DNS TTL expires. You must create your DNS entries correctly before Cloud Run can complete the domain mapping for you which also involves creating an SSL certificate for you. – John Hanley Aug 07 '19 at 21:42
  • One item that is not clear in your question. You must create two domain mappings. One for example.com and the second for www.example.com. – John Hanley Aug 08 '19 at 14:14
  • I did (we already talked (: https://stackoverflow.com/q/56688274/102133). here, example.com settled with no problems, www got stuck. Besides this specific error/issue, overall I'm having weirds issues, quite randomly (am currently migrating a bunch of non-critical sites to cloudrun). Let's say i've already set abc.xyz.com, def.xyz.com, all greens, no problems to access those. I've just created ghf.xyz.com, it got green on the ui, but eventhough the ssl have been created, it returns errors when trying to visit the page (tried to curl from different servers/locations, same error) – Ben Aug 08 '19 at 14:36
  • When debugging problems like this you need to be price. Use tools like MxToolbox to debug your issues. – John Hanley Aug 08 '19 at 14:43
  • talking about mxtoolbox, I don't see much issues when i just get here https://mxtoolbox.com/DNSLookup.aspx ; with the `:all` suffix it starts to show some (`We were not able to find a Start of Authority (SOA) record which may indicate a DNS problem.` appears) do you have any experience about what would be the commons warnings ? – Ben Aug 08 '19 at 15:27
  • anyhow I'll find out; thx a lot for your help here – Ben Aug 08 '19 at 15:27
  • 1
    MxToolbox has something like 50 tools. Time to learn how DNS works and how to test and debug issues. – John Hanley Aug 08 '19 at 15:32
  • @JohnHanley still; arent't those problems bound to cname use ? I have to say that i exclusively used nginx / a records for years, those kind of issues just never happened – Ben Aug 09 '19 at 03:43
  • Since we don't know what you are doing wrong, I cannot answer. However, you must configure DNS as Cloud Run wants or custom domain mappings won't work. This process is so simple to do, I am very curious what it is that you are doing wrong. – John Hanley Aug 09 '19 at 04:12
  • I guess we both know what cloud run wants (a cname record pointing to `ghs.googlehosted.com.`), indeed the process is extremely simple. I see from mxtoolbox, when digging into dns, that i have a `Bad Glue Detected` issue, which then might cause another `Local NS list does not match Parent NS list`; does it speaks to you ? – Ben Aug 09 '19 at 05:46
  • btw, isn't cloud run using letsencrypt ? if for some reasons the quota has been exceeded, then one is stuck for 5 days. The www domain does responds via curl over plain http:// – Ben Aug 09 '19 at 05:52
  • 1) Let's assume for a moment that it is a Let's Encrypt issue. Delete the Cloud Run service and redeploy with a different service name. ) The "glue" issue may or may not be a problem. Once again I don't know as I cannot see or test your records. – John Hanley Aug 09 '19 at 07:10

0 Answers0