Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  1. A record with IP addresses:
    owon.ro. ->
    216.239.32.21
    216.239.34.21
    216.239.36.21
    216.239.38.21

  2. 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

like image 458
Andrei Onel Avatar asked Jan 16 '16 11:01

Andrei Onel


2 Answers

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

like image 200
Andrei Onel Avatar answered Oct 12 '22 09:10

Andrei Onel


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.
like image 44
Dan Cornilescu Avatar answered Oct 12 '22 09:10

Dan Cornilescu