google cloud DNS zone mapping from naked to www URL - google-cloud-dns

I am trying to get my naked domain URL example.com to map to www.example.com. Can someone please give me the step by step procedure to get this working. I can't get it working, no matter what I try
Here is my setup:
1) Domain is registered on GoDaddy, the GoDaddy DNS is pointing to google (ns-cloud-a1.googledomains.com etc..)
2) Website is hosted on google cloud storage bucket www.example.com (domain also verified by google domain)
3) Under google cloud DNS, below is my zone file.
example.com. A 3600
216.239.32.21
216.239.34.21
216.239.36.21
216.239.38.21
example.com. AAAA 3600
2001:4860:4802:32::15
2001:4860:4802:34::15
2001:4860:4802:36::15
2001:4860:4802:38::15
example.com. MX 3600
0 aspmx.l.google.com.
5 alt1.aspmx.l.google.com.
5 alt2.aspmx.l.google.com.
10 alt3.aspmx.l.google.com.
10 alt4.aspmx.l.google.com.
example.com. NS 21600
ns-cloud-a1.googledomains.com.
ns-cloud-a2.googledomains.com.
ns-cloud-a3.googledomains.com.
ns-cloud-a4.googledomains.com.
example.com. SOA 21600
ns-cloud-a1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 3600 259200 300
www.example.com. CNAME 3600
c.storage.googleapis.com.
when i go to www.example.com, everything works fine. However when I go to example.com google says "404. That’s an error. The requested URL / was not found on this server. That’s all we know." And if i remove the A and AAAA records, the page just won't load.
All i am looking for is have example.com redirect/forward to www.example.com but cant seem to get it working.
Thank you for your help

You may also redirect the A/AAAA record to example.com. You can do that simultaneously from Cloud DNS (GCP). Pointing A record to www.example.com & example.com

Related

Redirect apex domain to www using route53 alias record not working

I had my example.com and www.example.com pointed to the same IP 111.222.333.444 in AWS route53 via A records.
Now I want to redirect example.com to www.example.com .
In route53 I changed example.com A record to an alias record, “Alias to another record in this hosted zone”. Then in the next field I selected www.example.com.
After 24 hours, I can still access http://example.com. It is not redirected to http://www.example.com.

CloudFront double redirect my naked domain

I followed the accepted answer here:
Cloudfront redirect www to naked domain with ssl
Here is what I did:
Create two S3 buckets named: example.com and www.example.com.
2.Turn on the Static Website Hosting on these two buckets.
3.Configure redirect in bucket www.example.com to bucket www.example.com. Protocol I chose https
4.For these buckets create two CloudFront Distributions. Each of this distributions point to corresponding bucket:
For Origin Domain Name provide bucket urls provided in Static Website Hosting section. The urls should have form (or similar): example.com.s3-website-us-west-1.amazonaws.com
On both distribution set HTTP to HTTPS redirect.
Route 53 configure DNS by setting:
An Aias records for example.com to point to corresponding CloudFront distribution.
An CNAME for www.xample.com to point to corresponding CloudFront distribution
The result:
http://www.example.com gets redirected to https://example.com
https://www.example.com gets redirected to https://example.com
This is the strange one:
When I enter example.com directly on my browser, I noticed that it gets redirected very quickly to http://www.example.com or (or https://www.example.com, it's too fast, I can't see it well), then immediately gets redirected to https://example.com.
Why there is a double direction here?
thx.

Pointing 1and1 domain to an S3 bucket

I've registered my domain about a month ago (It's a .com, so I need to wait 60 days before being allowed to transfer the domain, which I will do as I'm fed up with 1and1's service)
I created an Amazon S3 bucket with my domain name: example.com and www.example.com.
All my Amazon S3 settings are in order, I've enabled website hosting, I have an index document...
In 1and1, I've set my redirect destination for example.com to my S3 bucket endpoint.
When I hit save: "Operation Failed, The redirect URL is invalid."
What am I doing wrong?
You do not have to wait 60 days.
There are two different services that are commonly confused because providers often market then together: domain registrar services and domain hosting.
You can change your hosting provider at any time, by changing the configuration options with the current registrar. This change typically takes effect almost immediately, though conventional wisdom is that it may require up to 48 hours to take effect globally.
Create a new "hosted zone" in Route 53 for your domain. Take note of the four "awsdns" name servers that Route 53 assigns.
Log in to your registrar's admin portal and find the option the change your authoritative name server configuration. Replace the registrar's default name servers with the four provided by Route 53.
You will then use the Route 53 console to create your DNS records, including the appropriate "Alias" records pointing your domain to the S3 web site endpoint.
After the 60 days, you can change the registrar to Route 53, or any other registrar you like, continuing to use the authoritative name servers assigned to your domain by Route 53.
Route 53 is the simplest option for DNS hosting when you are using S3 for static website hosting (or CloudFront or Elastic Load Balancer) simply because of the tight integration provided by Alias records, which offer capabilities that CNAMEs can't and other DNS hosting providers can't, because they don't have direct access to the operational internals of AWS.
It sounds like you configured your domain name to use a Redirect instead of a CNAME record. Create a CNAME record to your AWS domain.
Here are some instructions:
http://help.1and1.com/domains-c36931/manage-domains-c79822/dns-c37586/enter-a-cname-record-for-your-domain-a643600.html
Sometimes people don't want to create CNAMEs for their root domain and prefer to redirect from example.com to www.example.com

Redirect domain.com to www.domain.com with CNAME and Openshift

For eg. my domain is domain.com ( :D ) and my Openshift server has this url: domain-spiderman.rhcloud.com. (not true).
Now, I'm trying to configure the DNS zone so that:
domain.com redirects to www.domain.com
www.domain.com loads the website
The configuration I have already applied is this:
domain.com. NS dns111.ovh.net.
domain.com. NS ns111.ovh.net.
domain.com. MX 1 mx1.ovh.net.
domain.com. MX 5 mx2.ovh.net.
domain.com. MX 100 mxb.ovh.net.
domain.com. CNAME domain-spiderman.rhcloud.com.
www.domain.com. CNAME domain.com.
domain.com. SPF "v=spf1 include:mx.ovh.com ~all"
The strange thing is that www.domain.com correctly loads the page, while domain.com has a loop towards domain.com and finally brake up.
Any help?
I use this service (not endorsing anything, I don't know how safe it is or anything. I use it for my blog, so no stress):
http://wwwizer.com/naked-domain-redirect
Just point your naked domain A record to 174.129.25.170

Stopping the naked domain redirecting to www

i recently migrated my application to AWS and setup a cname for www.domain.com and a redirect for the domain.com to redirect to www.domain.com.
The problem is, an external service was using a path on the naked domain.com (something like domain.com/external/service/) But with the redirect all HTTP POST data is being dropped with the redirect and i cant change the url that the external service is calling.
To fix this, i have setup my naked domain on route53 to point to my elastic load balancer where my app is located. I set up an A record pointed at my elastic load balancer using an alias.
Its been two days now and my naked domain still redirects to www. and therefore the external service is down. Any ideas on what i could do?
I am taking a long shot - there are different possible problems:
You are forwarding naked domain via A record to ELB, but your EC2 instace (say Apache) is still doing a redirect (not DNS, but http 301) back to www.
Check the DNS TTL. If the TTL is too large (say 48 hrs), then it takes that time. You need to wait longer.
Is Route53 fully managing your DNS? One possibility is that, somebody else like Godaddy is still doing the DNS for you - so nobody is contacting Route53 for the change to reflect.