Setting up custom domain with www on appengine - google-app-engine

I've set up a custom domain with Appengine.
The domain currently works as http://example.com (naked domain) but it throws a "This webpage is not available" error with http://www.example.com
Any idea how could I get the 'www' subdomain working? Would it be possible to fix it by adding/changing the DNS records (CNAME, TXT)?

The procedure is as follows:
Navigate to
https://console.developers.google.com/project/yourapp/appengine/settings/domains,
having replaced "yourapp" with your project name.
Click "Add custom Domain"
Go to the 2nd section (it will say "Select the domain you want to point to yourapp").
In that section, select the 2nd field, fill in "www" and select the domain in the dropdown.
Log in to your DNS management dashboard (this could be godaddy.com, namecheap.com, etc).
Add a CNAME record with your DNS host, as follows: alias: "www", address (canonical name): ghs.googlehosted.com, and save.
Give it a few minutes, and www.yoursite.com should now take you to your app (should be the same that can be found at yourapp.appspot.com).
Assumptions I made:
That you wish to point the DNS record to the default module of your AppEngine project. Please leave a comment if you wish 'www' to point to a different module.
That you have already registered your domain with Google and have a TXT DNS record there, proving your ownership of the domain to Google.

Related

How to deploy React app using railway.app with custom domain name from Ionos

I am trying to use a custom domain name created on Ionis for a Vite/React app hosted on railway.app. I get stuck when trying to configure the CNAME in the Ionos control panel.
On railway.app I created a sample app using the Vite/React template. The app deployed successfully to the free domain name provided by railway. Now I want to use a custom domain name which I have registered with Ionos. According to the railway docs I need to add a CNAME record to the DNS settings for my domain. The data provided by railway is like this: {name: #, value: someURL}. When I try to create a CNAME record in my Ionos, the fields I have available are ”host name” and “points to”. I have populated the fields like so: {host name: #, points to: someURL}. But then I get error “A CNAME record can only be set for a subdomain. To alias your main domain please use Redirect”.
So I tried using a redirect, but then, when I go to my custom domain, the website doesn’t show; I get error “mycustomdomain.com sent an invalid response. ERR_SSL_PROTOCOL_ERROR”. What should I do?

How to create a CNAME alias with Google Domains

I'm trying to follow the steps on the Google Cloud Platform's Hosting a Static Website. The first step is to create a CNAME alias that points to c.storage.googleapis.com. How to do this depends on which domain registration service you use.
In my case, I got the domain (peek.solutions) on Goolge Domains itself:
However, I can't find Google Domains itself among the host-specific steps given by Google. How can I create the CNAME alias?
Click the icon in the DNS column.
In the following page, there is a section with the heading "Custom resource records."
You will see a drop down menu there where "A" is the default but you can select "CNAME" to create that type of record.

Get custom domain name to work with app engine instance?

I have a domain name purchased via google domains. I want to point it to my app engine instance. In the "custom domains" settings tab in the app engine console, I have the following:
I want both the "bare" and "www" flavors to point to my app engine instance:
http://example.com
http://www.example.com
I'm not sure which option to use for step #2 to get that to work?
Thanks
You'd be following the Adding a custom domain for your application procedure, with focus on section 4:
4. Continue to the next step the Add new custom domain form, selecting the custom domain you want to point to your App Engine app:
a. Refresh the console domain page so it will list the domains properly.
b. If you want to use a subdomain, such as www, use the second option (http://www.example.com).
c. If you want to use a naked domain, use the first option to specify a naked domain (such as http://example.com).
d. Click Add to create the desired mapping.
You need to specifically add both the naked domain and the www subdomain, explicitly, by running the entire section 4 twice, once selecting 4c and once selecting 4b, respectively.
To do that at step #2 (in the Add a custom domain screen illustrated in your image) you first select the 1st radiobutton, for http://example.com and click Add. Unfortunately you don't see this addition displayed anywhere in the developer console (AFAIK). When the custom domain config was done through Google Apps the naked domain was visible explicitly, but that's no longer available.
Then come back at the Add a custom domain screen and at step #2 select the 2nd radiobutton, fill in www in the text input area (if needed), select example.com from the dropdown list (if needed) and click Add. This adddition should cause a new entry to be listed in the Custom Domain main screen (the parent screen), with a www.example.com Custom domain name and a www Alias.
This should be all (it may take a while for the DNS changes to propagate to your machine so that you can verify the effects, the doc mentions up to 24h).

Google app engine own domain

Im having trouble with Google App Engine and using my own domain. I have a domain that i'm also using in Google Apps for Work.
I have connected my GAE project in Google Apps so they are linked.
I have added my custom domain in GAE, verified ownership and it seems to be correct.
Here is a picture of the GAE settings.
And on Google Apps for work.
The other setting I know I have to do is on my domain registrar. I have added the records from GAE, from the picture I uploaded.
Im using one.com as a domain registrar and my DNS settings look like this:
Am I doing something wrong that you can see directly like "Hey what's this guy doing lol" or does it seem correct at first sight?
Thankful for any help in the right direction.
#
EDIT:
After following the tip from comment, I have verified and mapped the domain "lkpgpremiumcars.com". And added "beta" as subdomain. My "Custom domains" looks the same (like below):
I also removed A and AAAA-records and added a CNAME.
Waiting for DNS update to see if it works.
EDIT 2:
Still dont work.
BTW is it normal behavior that if I select the same subdomain again it says this:
Or is is just because it already points to this app?
You'll need to add this as a sub-domain.
First remove the custom domain (beta.lkpgpremiumcars.com) from the developers console.
Remove the A and AAAA records that you've added to the DNS.
Follow the instructions here and on step 1, only add the domain 'lkpgpremiumcars.com' and verify. This doesn't mean you're pointing the naked domain to your application.
Once it's verified, refresh the page and now you should have the domain available on step 2.
Select the second option on step 2, put 'beta' on the text box and select the previously added domain from the drop down beside. Click Add.
Go back to your DNS settings and add a CNAME record for 'beta' pointing to 'ghs.googlehosted.com.
Allow some time for propagation and it should work!

Google cloud DNS: point naked domain to www?

I maintain the owon.ro domain which uses a simple App engine app.
I also we use google cloud dns.
These are the dns records:
A record with IP addresses:
owon.ro. ->
216.239.32.21
216.239.34.21
216.239.36.21
216.239.38.21
CNAME
www.owon.ro. -> ghs.googlehosted.com.
And also some MX records.
The problem is that the app is reachable from the www subdomain and the help section states that those IP addresses should be in the A record for the naked domain to redirect to www, but it doesn't work.
I also tried to use # wildcard for the A record but that doesn't work also.
If you go to owon.ro you will see a 404 page but the www subdomain works.
Am I missing something?
Thank you
Found the answer in the end thanks to Dan Cornilescu.
If you use Google Apps you can set up to redirect the naked domain to www.
If not, you will need to follow the steps by going to
Console > App engine > Settings > Custom Domain.
In here, at the second step, you will have to point www to the app (by using the second option) and clicking Add.
And then also point the naked domain to it by choosing the first option and clicking Add again.
So if I understand correctly you will server the app using www subdomain and the naked domain in contrast to redirecting the naked domain to www as in the Google apps case.
In the end, my custom domain tab looked like this.
And my DNS records looked like this
The DNS operations suggested in step 5c (documentation here) are not enough, you also need to actually add the naked domain to the GAE config (in addition to the www one) - step 5d.
5. Continue to the next step the Add new custom domain form, selecting the custom domain you want to point to your App Engine app:
a. Refresh the console domain page so it will list the domains properly.
b. If you want to use a subdomain, such as www, use the second option (http://www.example.com);
c. If you want to use a naked domain, use the first option to specify a naked domain (such as http://example.com).
d. Click Add to create the desired mapping.
To link the naked domain so it points to the www when you are NOT using appengine you simply add both the 'A' record and a '#' record pointing to the Google ips which are and look like this:
A 300
35.232.62.127
# A 300
216.239.32.21
216.239.34.21
216.239.36.21
216.239.38.21

Resources