Reputation: 25194
I have a Google App Engine working, and I have bought a domain. To link the two, I followed the official guide.
Specifically, the guide suggests setting up these DNS rules:
The thing is, I own both the naked domain (site.com) and the www subdomain (www.site.com). Following the guide, I set up the following rules:
Type Name Value
A site.com. 216.239.32.21
A site.com. 216.239.34.21
A site.com. 216.239.36.21
A site.com. 216.239.38.21
(other AAAA for site.com.)
CNAME www.site.com. ghs.googlehosted.com
I think what I did is correct, because it works: I can type both site.com and www.site.com and be directed to my app. But I have some confusion regarding the www subdomain.
What is ghs.googlehosted.com , and why do I need a CNAME on that for the www subdomain? Why no A records for www?
How is the subdomain working? I have no A records for that, just this CNAME, but still it points to my IP.
I don’t understand the guide when it says:
Typically you list the host name along with the canonical name as the address. In our example, one of the records you would add is the host name www with the address ghs.googlehosted.com. (If you use a naked domain, you would use @ as the host name and a corresponding value from the Add new custom domain form.)
Can you explain the meaning of this paragraph? What’s this @?
Upvotes: 11
Views: 8836
Reputation: 41559
I've just been through this process, and was also confused by the requirements shown on the screenshot presented by the OP. In 2020 it still looks pretty much the same.
It does seem to imply you need A, AAAA and CNAME (which is makes no sense - A and CNAME are contradictory). My DNS registrar - cloudflare - does not allow you to setup these options together.
To help anyone else searching and finding this page, I noticed on this page of docu the following line:
Record type: Enter the record type that is shown in the DNS record Google created for you (A, or AAAA, or CNAME).
This makes it clear you can just setup one set.
Upvotes: 3
Reputation: 1563
The guide is suggesting you to use one of the DNS type either use A and AAAA(IPv6) or CNAME.
1) You can use A & AAAA record for www subdomain. Just make the DNS to
A www.site.com. 216.239.38.21
(other AAAA for site.com.)
2) The reason why your www subdomain is working because your pointing www.site.com -> ghs.googlehosted.com. See there is www. before your site.com
CNAME www.site.com. ghs.googlehosted.com
3) @ is used to denote the current origin. So when you use @ it translates to site.com.
To make things simpler i would just use the following DNS entries. This way my website is accessible by both naked domain and www subdomain.
CNAME www.site.com. ghs.googlehosted.com
CNAME @ ghs.googlehosted.com
If you just want to serve your website via naked domain.
CNAME www.site.com. site.com
CNAME @ ghs.googlehosted.com
Here we point our www subdomain to naked domain.
Upvotes: 4