Issue routing custom domain to GCP's VM Instance - google-cloud-platform

When I type in my custom domain, http://jakeyoon.dev , I get ERR_CONNECTION_TIMD_OUT.
I purchased the domain from Google Domain and set up a simple LAMP stack using GCP Marketplace and VM Instances.
I added A record from Google Domain's DNS Settings that points to VM Instance's external IP address.
I also added a CNAME to route www.jakeyoon.dev to jakeyoon.dev
I didn't change any name server
VM's external IP works when just routing directly.
http://34.134.167.124/
I get the correct IP address when I do a DNS resolve
https://dns.google/query?name=jakeyoon.dev
I would appreciate any advice!
Do I need to host a zone and use Cloud DNS from GCP?
What else do I need to change from Google Domains?
Thanks

Related

How to run a ec2 instance as subdomain in siteground?

I have a Wordpress website with a GoDaddy domain being hosted on SiteGround using the nameservers. I am looking to switch to a React App which is currently running on an EC2 instance in AWS. I want to run the ec2 instance (aka the react app) on a subdomain like beta.domain.com inside SiteGround while still keeping the Wordpress website since its a part of my business. I tried creating a subdomain in SiteGround and then pointed it to my EC2 instance elastic IP (the public ipv4) using an A record but it is showing "This site can't be reached" error once I go to beta.domain.com.
What am I doing wrong? How do I run the EC2 instance in a subdomain hosted in SiteGround?
EDIT
Thank you, everyone, for your help. The problem was the SSL certificate for the HTTPS. The website wasn't coming on due to the HTTPS setup on the Nginx on the EC2 instance. After I put in the details of the certificate it runs properly with just the A record.
Any public address in the AWS environment are never accessible from outside the security groups. Even if you try to ssh from your own machine and if it is not in the inbound rule of the security group of your EC2 instance. I feel there are 3 ways out here.
1.) Adding an all traffic rule in your EC2 Security group inbound rule. This is not recommended as it opens all traffic to your machine.(additional tip: set up secure ssh key with the machine)
2.) Use an ELB to route traffic to your EC2 instance. ELB will provide you with a DNS record which can be used an a CNAME in godaddy(Point 3 shows how to map it as a A record in GoDaddy)
3.) Using Route 53 Hosted Zones - You could delegate your DNS to be managed by AWS Route 53. This way all traffic will be routed to your machine by AWS R53.
Another tip: Elastic IP can also be used which are like permanent static IP Addresses accessible from across internet. This provided a secure communication method to your instances.
Let me know what could be the favorable solution for you. I could help you out further
If you have registered your domain name with Goaddy, you can create subdomain in Godaddy as CNAME and point it to static IP address of your ec2 instance. Here is a link to guide you.
Also your main domain name will point to your Wordpress website on SiteGround.
Now that you have EC2 instance, you can also run a wordpress site on that instance if you like.

public instance CNAME for GCP compute instance

Azure provides a way to access a VM using *.cloudapp.net, is there something similar in GCP? If yes, where/how can I see the exact CNAME for accessing the instnace?
I read it that its *.googleapi.com, but not able to find it anywhere on GCP portal
Note this SO question comments says it should be of format computername.c.googleprojectid.googleapis.com, is that not correct?
Google Cloud Compute Engine virtual machines (instances) are accessed by IP address outside Google Cloud or by internal DNS name inside Google Cloud. If you want a public DNS name, you must configure the public DNS name in your DNS server for your domain name.
Google Cloud does create an internal DNS name for your instance. However, this DNS name is private and only resolves in the same VPC as the instance.
You could use Cloud DNS, while setting the name-servers at the registrar to Cloud DNS.
See Updating your domain's name servers.
This means, you'd have to provide your own domain-name and at least one external IP - even with external DNS. The location of the zone-file to edit merely depends upon which name-servers the domain registration has set.

GKE - Private Cloud DNS addresses, how to access endpoints from office

I have the following setup:
GKE - Running many pods, annotated with External DNS endpoints.
External DNS running, creating DNS addresses in Cloud DNS.
Cloud DNS managed zone, with addresses automatically upserted from GKE.
I don't want to expose these dns addresses to the internet, as this is a testing cluster, but i'd like to open it to, set's say, my offices ip, address.
I'm not sure how/where to even start with this in GCP, I'm sure there's a product name for this that I'm just missing. :/
Cheers,
Ben

How to map an IP to a domain name?

I have a website hosted on AWS EC2, it has an IP which is public, I can access the website anywhere from the public IP.
I have rented a domain name and the provider gave me a console.
I am expecting this console has a field for me to enter public IP. Then it will resolve the connection between the domain name and public IP.
However, the console only provides a link called "Modify DNS", and it expects me to provide NS (at least 2). I don't know what to input at all.
In this case, how can I find 2 NS? or there should be another way to do so?
A few steps to do here:
You need to add a Hosted Zone for your domain to Route53 in the AWS Console. This hosted zone will automatically generate 3-4 random AWS DNS name servers.
Use those name servers with your domain name provider. Your domain is now pointing at AWS' name servers.
In Route53, add an A Record for your domain name which points to the IP address of the server in AWS that's hosting your website.
Note that unless you've assigned an elastic (think static) IP address to your web server in AWS, the IP will change if you stop/start it, or terminate it and replace it (just rebooting however keeps the IP).
Also note there are small charges for using Route53 and Elastic IPs.

How redirect a domain to Amazon EC2 Machine?

I'm using EC2 of Amazon to host a website built in JSP :
http://ec2-50-17-144-64.compute-1.amazonaws.com:8080/p2p
And I bought this domain:
www.p2pbrasil.com
How can I redirect www.p2pbrasil.com to my website in Amazon EC2 ?
When someone type www.p2pbrasil.com it redirects to http://ec2-50-17-144-64.compute-1.amazonaws.com:8080/p2p ?
You need to do two things
In the Amazon Web Service admin panel, create an elastic IP in the same region as your instance and associate that IP with your that instance (IPs cost nothing while they are associated with an instance, but do cost if not).
Add a A record to the DNS record of your domain mapping the domain to the elastic IP address assigned in (1). Your domain provide should either give you some way to set the A record (the IP address), or it will give you a way to edit the nameservers of your domain.
If they do not allow you to set the A record directly, find a DNS management service like ZoneEdit, register your domain as a zone there and ZoneEdit will give you the nameservers to enter in the admin panel of your domain provider. You can then add the A record for the domain in ZoneEdit.
I only mention ZoneEdit because the basic service is free, you could also use Amazon route 53 or a similar pay-for service, if you preferred.
Create an Elastic IP on the AWS Panel, then associate it to your instance.
Then use a DNS management service to add your domain and Ip address (Elastic IP), then on the domain provider panel add the DNS provided from the DNS management service.
I recommend EntryDNS which is actually free.
As you have your server on AWS best option is to use Route53 hosted zone.By doing this you can manage all your DNS entries using AWS. In future if you plan to use ELB's for your application, you can various traffic routing options using Route53.
Create Hosted Zone and get the name servers.
Replace current name servers with AWS nameservers from your Domain registrars DNS entries.
Create an A record in AWS hosted zone and give your servers IP (Elastic IP) as value.
For detailed instruction, you can follow this blog post. Mapping Domain Name to EC2 Server
Assuming this is a hobby website and your domain registrar isn't AWS.
If your registrar (for example godaddy.com) provides a DNS manager you simply need to add a CNAME record for www that points to the aws public DNS record for your instance. For example ec2-50-17-144-64.compute-1.amazonaws.com
This will make http://www.p2pbrasil.com display the same content as http://ec2-50-17-144-64.compute-1.amazonaws.com
Doing it this way you don't have to pay for an elastic IP, which is a dedicated resource. Your IP on your ec2 instance shouldn't change but could if you restart your instance.
Put the public IP from your EC2 instance as an A name to your root domain in Route 53 hosted zone.
This change might take some time.