How to configure DNS record on Google Cloud - google-cloud-dns

I have a domain with Google, and I want to configure DNS on Google Cloud to use "www.example.com", and not "sites.google.com/...."

The typical solution here is to use any of the following:
CNAME record that points domainname.com to domainname.provider.com
A record that points domainname.com to the same IP address that domainname.provider.com
This should work for several different providers. But many providers use 'virtual hosting' which means that a single server, identified by an IP address, will be serving different websites, and will use the domain name as sent by an HTTP header. You need to tell the provider, sites.google.com, that domainname.com is a valid name for the server as well.

You could configure a CNAME Record, this is used in the DNS to create an alias from one domain name to another domain name:
Example:
www.yourdomain.com CNAME yourdomain.com
You could need also an A Record to point your Ip address at your domain. The A record translate the human readable domain name to an IP address.
Example:
yourdomain.com. A192.162.101.100 .
If you already has the CNAME Record you can go to the Google cloud console and select the Cloud DNS page, once there you can follow the next steps:
Click the zone for which you want to create a resource record set.
On the Zone details page, click Add record set.
Enter the DNS name for the record set—for example, test.example.com.
Select the resource record type. (here you can chose the CNAME record)
Enter the time to live (TTL) for the resource record set—for example, 30
Select the TTL unit—for example, minutes.
Enter the details based on the record type that you have selected.
Click Create.
In the next link you can find more information related to manage record

Related

How to use hostinger domain with github pages

I have a website hosted on github pages and I bought a domain name from hostinger. I am adding A records and CNAME. But the website is going to "parked domain name on hostinger" instead of my github page. Afaik I am doing everything correctly and adding the correct IPs in the A records.
i think you should try with CNAM record.
this is what this doc says
https://docs.github.com/en/free-pro-team#latest/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site
Create two AAAA DNS adress and put the following ipv6 adresses:
2606:50c0:8000::153 and
2606:50c0:8000::154

Correct structure for custom domain feature for SAAS users

I am building a Saas platform (lets assume domain is www.saas.com) where user have unique subdomains such as user1.saas.com, user2.saas.com etc. And give them a feature to add their own custom domain.
To add custom domain, users define cname for app.saas.com and A record for public id in of my app.
Everything is working fine if cname and A record is defined correctly by users. But i have two concers about this:
To host my app, i used cloudways and select digital ocean servers. But if i want to move from Digital Ocean to AWS at some point, then public ip is going to change. So custom domains wont work until users change their A record.I wonder if is there a better way to give custom domain feature to user instead of adding A record? (I am not sure if cname and a record is the correct way for this feature)
Let's assume user1 is defined own domain for user1.saas.com. When i go to user1.saas.com, it is also working. I think, i should redirect this url to custom domain if it is defined. I wonder if this is a correct way?
Thanks in advance
Anil

Naked Root Domain Hosting

The usual approach calls for pointing mysite.com to www.mysite.com.
But suppose that I would like not to redirect. In other words, I would like to set up a naked root domain, without setting up any sub-domains, not even www.mysite.com.
I am using Route53 and S3. Presumably I would need just one hosted zone (mysite.com). Do I still need two buckets (mysite.com and www.mysite.com) or can I set up just mysite.com?
Set up the bucket, named for your domain name. The bucket name has to match exactly the address that shows in the browser's address bar.
Then, create an A record at the root (apex) of the domain in Route 53, leaving the hostname empty, selecting "Yes" for Alias, then select the bucket in the drop down list.
That is all you have to do.
If you create a "www" CNAME pointing to the domain name itself, this will not work with S3 web site hosting, because the bucket name won't match what's in the address bar of the browser (and a CNAME does not cause the browser to change the address bar to the target).
Everything in DNS that points to S3 must have a corresponding bucket that matches the DNS entry. That's how it was designed.
Because people are often very prone to typing "www" in front of web site hostnames, you probably should create a second bucket with "www."+your domain name as the bucket name, then configure that bucket to redirect all requests to the root domain name, and set an additional Alias record on S3 -- because that way if a user types "www.example.com" into their browser, it will hit the second bucket and redirect -- by changing the browser's address bar -- to the root domain... which almost certainly is what you actually want, from a usability perspective.
Edit after some testing on one of my extra domains. The information
posted below is incorrect. I'll leave this here so others don't follow down this incorrect path.
--------------------------------
That's what CNAME records do for you. Just add a CNAME for 'www' that goes to yourdomain.com
Both www.yourdomain.com and yourdomain.com will work in the browser without any redirection.
in Route53 it will look like this.

Heroku/GoDaddy: send naked domain to www [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am trying to figure out how to get the naked domain for my website to redirect to the www domain. I am using Heroku and have the domain from GoDaddy. Because of Heroku, my A records are already set up as:
#: 75.101.145.87
#: 75.101.163.44
#: 174.129.25.170
And my www CNAME points to proxy.heroku.com.
I've been looking all over the internet, but can't find a simple, free answer for how I can do this redirect. Some answers discuss using paid services, which I don't want to do, and others talk about going in and modifying Heroku settings, but then don't really give much explanation. Right now, if you go to my naked domain, it's just Heroku saying that no such app exists, while if you go to my www domain it's my app.
On GoDaddy, use the "Forwarding" feature to setup a forward from yourdomain.example to www.yourdomain.example. The forwarding feature can be accessed in the Domain Manager at the bottom of the "Domain Information" section:
If you do this then all traffic to yourdomain.example will be routed to the Heroku app CNAME (which is the better approach).
One note, however, if you are on the Cedar stack then don't use proxy.heroku.com for the host of your www CNAME. Instead use your-app-name.herokuapp.com. These details are covered here.
GoDaddy also specifies that in order for your domain name to forward, its A record must be pointed to 64.202.189.170 or must fall between the following ranges: 50.63.202.1 - 50.63.202.31 or 184.168.221.1 - 184.168.221.31.
You could also use http://wwwizer.com to forward from your naked domain to your www. In GoDaddy in the DNS manager under the A record in the # heading type in 174.129.25.170. They will automatically redirect from the naked domain to one with www. in front of it.
In GoDaddy's DNS Zone Editor, you will want to configure your CNAME record www to point to #. In your A Record, you'll use a wildcard (*) to point to the IP address and a second A Record that uses # as the host that will also point to the web address. This way,
subdomain1.example.com will forward to your IP
www.example.com will forward to your IP
silly.example.com will forward to your IP
anything.example.com will forward to your IP
Frequently Asked Questions
Can I point *.mydomain.example to my Heroku app?
Yes, using the free Custom Domains feature of Heroku you can point a wildcard domain to your application.
What IP addresses should I use to point my custom domain to Heroku?
The Heroku routing stack uses a collection of IP addresses that can
change at any time, and using A records to point to your app is not
supported. To ensure your domain always points correctly to the
routing mesh, configure subdomains (e.g. www in www.example.org) using
a CNAME record:
If the app is on… Then CNAME the subdomain to
Bamboo yourapp.heroku.com
Cedar yourapp.herokuapp.com
Naked (or bare/apex) domains (e.g. example.org) should be avoided
because of their availability and uptime consequences.
Why can't I add subdomain.mydomain.example for my app?
In some cases, attempts to add a custom domain (like
subdomain.mydomain.example) for an app may result in an error like this:
! mydomain.example is owned by another user
All applications for a given base domain must be owned by the same
Heroku account. The above error means that someone else has already
added a mydomain.example custom domain to one of their apps.
If you have the IP addresses setup on your naked domain and your www cname'd to yourappname.herokuapp.com then all you need do is use something like RackRewrite in your application to redirect the requests when they arrive at your application.
What you want to setup is any request to the naked domain gets redirected to your www address. After following the installation instructions add an initializer in config/initializers
ApplicationName::Application.config.middleware.insert_before(Rack::Lock, Rack
r301 %r{.*}, 'http://www.yourdomain.example$&', :if => Proc.new {|rack_env
rack_env['SERVER_NAME'] != 'www.yourdomain.example'
}
end if Rails.env == 'production'
Which is saying, if the requested URL is not www.yourdomain.example then 301 redirect it to the www.yuordomain.example but only if it's running in production.
For this to work with Network Solutions do the following:
Network Solutions pointing yourdomain.example to www.yourdomain.example.
Here's how.
Within Account Manager, select My Domain Names
Select the domain name that you want to manage
In the green box, select Change Where Domain Points
Select Advanced DNS, then Continue
First, edit the A Records by selecting Edit A Records
*For the "# none" enter the following IP address 205.178.189.129, clear the records for the "www" and " (All others)"**,
then select Continue
Second, edit the Host Aliases (CNAME records) by selecting Edit CNAME Records
Enter "www" in the Alias column
Leave TTL set to 7200 but on the same line, enter the name servers provided by the blogging service in the Other Host section
[ IE
FOLLOW THE HEROKU INSTRUCTIONS NOW www --> yourapp.herokuapp.com (Cedar Stack) ]
Select Continue
Now wait and check the domain(s) with the following terminal command:
host domain.example
host www.domain.example

Google Apps: verify domain ownership using CNAME

I understand CNAME is an alias to another record. Since I am using melbourneIT for my domain name, when I set up Google Apps, I need to verify my domain name ownership through CNAME record change.
However when I see page: http://support.google.com/a/bin/answer.py?hl=en&answer=142005#CNAME (please tick "I want to verify using a CNAME record"), I am totally confused at what information to use in order to create the CNAME record for this verification purpose.
Please see below for the information from http://support.google.com/a/bin/answer.py?hl=en&answer=142005#CNAME:
Host Name/Alias Value/Destination
Custom URL: www ghs.google.com
Verification: googlefffggghhh12345 (your unique string) google.com
If my domain name is mydomainname.com, what should I put into my CNAME record (the value for HOSTNAME and POINTS TO, as in my DNS management panel shows)?
It's confusing because it looks like two entries. I think you want to use the second set of criteria for verification. So you'd enter the googlefffggghhh12345 as the alias(or host), and it would point to google.com.
You might want to do both or alternatively do mail as a cname and point it to ghs.google.com. You'll want to do that eventually anyway.
The cname, www pointing to ghs.google.com, is consistent with telling your domain host to check to see if there's a webpage setup in google sites and send people there. If there isn't one, and there isn't a sitemap within apps for one, I think the domain would just return to current hosting.