Linking domain via cloudflare to google cloud - dns

Oke so here is the situation:
I have bought a domain from a registrar(hostnet) and my hosting is on Google Cloud.
Now i want to link the domain i bought from hostnet via cloudflare to Google Cloud.
I changed the nameservers of the registrar to use cloudflares nameservers. And then on cloudflare i changed the A records to point to my Google Cloud external IP-address.
The site works fine but on Google Pagespeed insight i see a 'delay in server response' so i'm thinking im doing something wrong. Also i haven't done anything on Google Cloud so it seems more like a redirect(slow) rather than a correct implementation. That would mean anyone could link any domain name to my ip address.. that seems off.
What would be the correct way to connect my domain from hostnet to my google cloud via cloudflares cdn.

Related

Used the Same DNS address in Google Domain and Google Cloud but cannot view website

I have my Domain name through Google Domain and I have set up my website on Google Cloud. But I cannot get to my website.
I used the same DNS servers for in Google Domain/DNS/Google Named Servers and Google Cloud/Network Services/Cloud DNS Type NS.
ns-cloud-c1.googledomains.com
Can you tell me if this is correct?
Thank you

Private Server On Google Cloud Platform and CloudFlare

I am little new to hosting and so I am confused for take step. My current situation is like below
I have one big wordpress site in site ground. Domain is from Godaddy and I am using CloudFlar. I want move this site on Google cloud Instance. So I have created Google cloud instance and have installed Cpanel/WHM. I have copied site on newly created cpanel account. Now My confusion is How I should change DNS for point my domain to Google cloud.
Domain on : Godaddy, Using CloudFlare : Yes, Current Hosting : Site
Ground, New Destination Hosting : Google Cloud, My Current Domain :
example.com
For More information I have setup host like host.example.com and NameServer as ns1.example.com and ns2.example.com on Google cloud. Let me know someone can help me for required step to change DNS so I can successfully move without downtime.
Thanks a lot.
You need to update the IP address for your domain in the DNS records which are hosted either with godaddy or with cloudflare. If you are not sure, do a dig NS yourdomain.com See which dns server's are coming. and accordingly make the change.

Google Cloud DNS and 301 redirects

Namecheap and other registrars provide a way to setup HTTP 301 or 302 redirects when configuring DNS. It is a nice feature since otherwise you would need to implement it yourself. See screenshot below from Namecheap DNS configuration page.
Does Google Cloud DNS offer something similar?
Google Cloud DNS does not provide a "URL Redirect". This isn't actually a DNS feature - it requires a webserver to serve the 302 redirect. You could implement this with a small cloud funciton like:
exports.redirectFunc = function redirectFunc (req, res) {
res.set('Location', 'https://example.com/destination');
res.status(302);
res.end();
};
Firebase now has a very simple setup to achieve domain redirection, just do the following:
[Your firebase project] > Console > Hosting > Connect domain
Then it should display the following:
Although Google Cloud DNS does not have this feature, if you register your domain with Google Domains, it has a "subdomain forwarding" feature (https://support.google.com/domains/answer/6072198 that implements not only 301 / 302 redirects but also provides integrations for G Suite and other platforms that set up other types of synthetic records (https://support.google.com/domains/answer/6069273).
Google Domains runs on the same DNS serving infrastructure as Google Cloud DNS, but currently you have to choose between the "Google Domains name servers" and Google Cloud DNS name servers that serve managed zones that you can control programmatically with the Google Cloud DNS API. This means you have to choose between the Domains-specific features like synthetic records and the Cloud DNS API and GUI console. You can delegate subdomains of a domain hosted on the Google Domains name servers to specific managed zones in Cloud DNS, so it is possible to mix and match this a bit.
Though it isn't supported directly in Cloud DNS yet (see issue: https://issuetracker.google.com/issues/70980380) a workaround can be to deploy an HTTP(S) Load Balancer and set up a redirect in the URL-map and then map the root domain to the IP address of the load balancer via an A record in Cloud DNS (and the same load balancer can be used to serve all subdomains as well without requiring any other Cloud DNS records), see: https://cloud.google.com/load-balancing/docs/url-map-concepts#url-redirects

Use Google Cloud DNS toto Create Vanity Nameservers?

I would like to set up our own name servers for our company - to look more professional, but also to ease future transitions to different servers. So for example:
ns1.mycompany.com
ns2.mycompany.com
I have a Google Cloud Platform account with access to the Google Cloud DNS API. My first question is... can I achieve this with Google Cloud DNS?
And if so... how/where do "point" domains to our services such as hosting and mail?
For example, I ask a client to change the name servers for client.com to ns1.mycompany.com and ns2.mycompany.com. And I have these name servers created in Google Cloud DNS. How/where do I then set the A or CNAME records to point to our host server and our mail server?
Thanks in advance.

DNS settings to host site externally

I have a domain that was purchased via Google Apps, the DNS management is through enom, but I wish to host the site elsewhere (but keep all of the Google apps services like docs, email, calendar as shown below). What do I need to change so I can point the site to my external hosting?
updated the www record with new host

Resources