How do I connect my domain from Domain.com to serve my website with Google Cloud Platform?

Viewed 304

enter image description hereFirst of all, I'm very new at this, with barely idea of anything about serving/domain websites. I've tried everything this weekend almost non-stop, I just want to serve my domain that I bought in Domain.com, through Google Cloud services since I have the free 300 USD trial.

What I did so far was creating an instance of VM with "Compute Engine" service, which is probably a mess since I touched the configs a lot. Then I created a bucket to store data with "Storage" service. Then again in Google Cloud Platform I created a zone in Cloud DNS using "Network Services". Again, I prolly messed a lot of the configs in there.

I will provide photos of the mess I did, don't worry (and sorry for the bad crop I had to put the photos all together somehow).

Well and then finally my domain (franfonse.com) that I bought through www.Domain.com. Trying to configure things out I added, verified, deleted and modified things a lot in the DNS records and Servernames.

Can someone just tell me what I should do? Because as I said I'm very new in this and I don't even know what is right or wrong of the things that I did anymore, I gave up.

Please, help!

1 Answers

To connect you domain to your website on GCP you should follow next steps:

  1. create public managed zone on Google Cloud DNS (if you want to use it, it's possible to use any DNS hosting you want)
  2. replace existed NS records with obtained at Google Cloud DNS (in your case records ns-cloud-b1-googledomains.com, ns-cloud-b2-googledomains.com, ns-cloud-b3-googledomains.com and ns-cloud-b4-googledomains.com) at domain registrar side (in your case DOMAIN.COM)
  3. reserve external static IP address for your VM
  4. create VM using reserved external static IP address and do not forget to enable HTTP/HTTPS access
  5. create A record
  6. install web server and configure web site
  7. check if required ports open with command nmap -Pn EXTERNAL_IP_OF_YOUR_VM and configure firewall if necessary
  8. access your web site by domain name http://franfonce.com

As it was suggested by @John Hanley, it's mandatory to use only necessary NS records at domain registrar side (in your case DOMAIN.COM). You should remove lia.ns.cloudflare.com and memphis.ns.cloudflare.com if you want to use Google Cloud DNS or remove ns-cloud-b1-googledomains.com, ns-cloud-b2-googledomains.com, ns-cloud-b3-googledomains.com and ns-cloud-b4-googledomains.com if you prefer Cloudflare DNS.

I do not recommend to change default TTL settings unless you do know for sure how they work, meanwhile you can set suggested by @John Hanley values instead of yours.

As I can see, you configured Cloudflare as DNS for your domain:

$ dig NS franfonse.com 
...

;; ANSWER SECTION:
franfonse.com.          86400   IN      NS      memphis.ns.cloudflare.com.
franfonse.com.          86400   IN      NS      lia.ns.cloudflare.com.

$ dig A franfonse.com
...

;; ANSWER SECTION:
franfonse.com.          300     IN      A       104.196.225.83

$ dig A www.franfonse.com 
...

;; ANSWER SECTION:
www.franfonse.com.      300     IN      A       104.196.225.83

and everything looks good at DNS side, but your site doesn't work:

This site can’t be reached

www.franfonse.com refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

and if we check current status of firewall:

$ nmap -Pn 104.196.225.83
Starting Nmap 7.70 ( https://nmap.org ) at 2020-03-23 10:20 CET
Nmap scan report for 83.225.196.104.bc.googleusercontent.com (104.196.225.83)
Host is up (0.13s latency).
Not shown: 996 filtered ports
PORT     STATE  SERVICE
22/tcp   open   ssh
80/tcp   closed http
443/tcp  closed https
3389/tcp closed ms-wbt-server

Nmap done: 1 IP address (1 host up) scanned in 11.49 seconds

we found that ports 80 and 443 are closed.

To solve issue with firewall you should open ports on firewall - go to Compute Engine -> VM instances -> click on NAME_OF_YOUR_VM -> click EDIT -> go to Firewall section and check Allow HTTP traffic and Allow HTTP traffic -> click Save. After that, check again with command nmap -Pn 104.196.225.83 if ports 80/443 (http/https) are open.

Related