redirecting a subdomain to google cloud - google-cloud-platform

I have domain under which there are multiple subdomains pointing to different websites hosted on azure. I am starting to explore google cloud and want to host a subdomain on google cloud.
Below is how DNS record should look like
A - GO Daddy hosted main website IP address
CNAME - subdomain.example.com - subdomain.cloudapp.net
CNAME - subdomain2.exapmple.com - subdomain2.cloudapp.net
now I want to add a cname for another subdomain to be hosted on google cloud
CNAME - subdomain3.example.com ??.googleapi.com
I have public IP address from GCP, but how do I get subdomain for GCP to be used for CNAME record? As per answers to my another question GCP does not provide public CNAME for VM instances. So what should I provided in CNAME record. (I do not want to move the DNS to google, or to azure for that matter)

Based on your question and the reference to Google not providing names for VM instances, I am assuming that you are trying to create a DNS record for the external address of a VM instance.
If you have a static IP address, you should just configure your DNS provider to use an A record for that IP address, rather than a CNAME.
CNAME records just create aliases for the target names, where A records can point directly to the correct IP.
Note that if the IP on your instance is ephemeral rather than static, then you would need to keep updating the DNS record whenever you restart the instance (and get a new IP), so it would be highly recommended to use a static IP for the instance in this case.

I often use App Engine, for a CNAME, you have to map to ghs.googlehosted.com (https://cloud.google.com/appengine/docs/standard/python/mapping-custom-domains).
It seems possible to do the same on Compute Engine through the network service (https://cloud.google.com/dns/docs/quickstart#create_a_cname_record). If you don't really need the CNAME record, you should use the classical A record. It's a bit easier.
Don't hesite to look into documentations, everything is explained.

Related

Showing IP in browsers instead of Domain after migration to Google Cloud

I have migrated my website to the Google Cloud servers. I have pointed the old DNS to the Google DNS and I have setup the DNS zone with an A record for the main domain pointing to the IP of the Google Cloud server and a CNAME record for the www subdomain. However, when I type the domain name in the browser, it loads the Google Cloud IP, but the browser doesn't show the domain name but the IP address.
You need only one DNS entry for the instance;
www aliased (A) to the (external) IP address of the server.
From your description I guess that you configured your Cloud DNS in a correct way and that your domain registrar is pointing to GCP DNS servers:
nameServers:
- ns-cloud-a1.googledomains.com.
- ns-cloud-a2.googledomains.com.
- ns-cloud-a3.googledomains.com.
- ns-cloud-a4.googledomains.com.
Nevertheless make sure your DNS configuration looks similar to this:
If you need to add some records to your DNS here's some usefull documentation on how to add records to do it. You can use both console or gcloud utility for this.
You may also have a look at the documentation on how to migrate to GCP from other providers.
But - I suspect some tricky-webserver configuration issue here. Why ?
You pointed out that you can reach your website - but instead of domain name you see a real IP of your site in the browser. That may be the result of a specific configuration that "redirects" you to a certain IP after detecting you used domain name to get to the server.
Please inspect your webserver's configuration and try to point out a real cause of this.

Where to find domain name to existing EC2 instance

I'm new AWS and I have to continue maintaining previous developer service that is hosted on AWS. The ec2 instance that is hosted has map to domain name of https://****c.k**g.g***an.org.au, however I couldn't find this domain name anywhere. I tried looking at route53, but there's no such domain name registered.
Please help, how do I find the domain name that is mapped to the EC2 instance? Where can I get that information. The reason because I want to deploy a new instance but with the same domain name.
Edit: Masking DNS for privacy reasons.
Are you sure your DNS is hosted by Route53? Running dig against k***.g****.org.au has the SOA held by ns1.mooball.net.
The whois for mooball.net returns register.com as the owner, so I would consider reaching out to your internal teams to see who holds that account, then check your DNS delegation settings by logging in to register.com.
Often times the client will control their own DNS, so it would also be worth confirming with your client where their root DNS (garvan.org.au) is hosted - you can then trace the subdomain delegation to see where it is ultimately hosted.
check route53 service in AWS , since the domain is served by https..it could be the domain mapped to a load balancer and the load balancer has the instance...anyway you can know from the route53 there you find all the records

Route 53 DNS: Different DNS for base URL and endpoints (test.co and test.co/api)

Hopefully you all can help - we're looking to migrate our website from an EC2 instance to Webflow hosting. Unfortunately, we'd like to keep our API on the EC2 instance. Is it possible (in DNS in general, and specifically with route53) to have one DNS record for test.co and it's URL's (text.co/zxc, test.co/abc) and one DNS record specifically for the API URLs (test.co/api/abc)?
This would make the process much, much easier, as we wouldn't have to migrate the files to our EC2 instance and could keep the benefits of hosting on Webflow. However, performance is a key concern here for the API layer - my gut tells me that redirects are slow, and would add time to every API call. Not ideal.
Let me know what you think - cheers!
Using Route53 (or any DNS host) you can only resolve the hostname part (not the path) of the URL to your EC2 instance (E.g test.co, text.co) using either using.
CName mapping to the Domain Name assigned to the EC2 instance
A Record to the IP of the EC2 instance
Note: It is recommended to setup an Elastic IP for the EC2 instance if you directly map the EC2 instance to Route53.
You need to map /zxc /abc and /api/abc paths to relevant routes inside your EC2 instance either at WebServer level or using a proxy (E.g Nginx, Apache).
Is it possible (in DNS in general, and specifically with route53) to
have one DNS record for test.co and it's URL's (text.co/zxc,
test.co/abc) and one DNS record specifically for the API URLs
(test.co/api/abc)?
The best solution is to create a subdomain. api.test.com, then create an "A" record that point your api.test.com to your EC2 instance.
NJOY

Is it possible to have GoDaddy host my domain name but use AWS to host my website?

I'm a little confused on what Aws is instructing me to do. They are telling me to transfer the name to Route 53 first which cost 12 bucks. Is there a way to not use Route 53 and still host my website using Aws?
Yes,
you can have your domain at any registrar and have your DNS zone hosted anywhere. Just modify DNS records to point to your AWS resources like ELB, EC2 or S3.
Amazon doesn't force you to use Route53.
Yes, this is pretty common.
In Route53, create a new zone for your domain. When you do this, you'll get the NS and SOA records created by default. There will be 4 NS entries. Add any other records you need.
Then, when you're ready to switcy, go to the godaddy DNS settings, and change the NS and SOA records to the values in the Route53 zone. By default, I think godaddy only shows 2 NS records, but you can add all 4.
AWS is boss, if you are trying to capitalize on the ACM and get a free SSL you do need to use Route53 to make it happen. Try to test a PTR - Pointer record to your ip address within the DNS to make everything working
Third Party Domain Registrar/DNS
Create a hosted zone through Route53 and erase all DNS/Nameservers
from your domain.
Add the four nameservers to your domain
registrar's DNS should have a mix of .org .com .net and .co.uk or
something similar. All four need to be insterted.
After creating your instance and having your domain pointed to it you will
need point the ip address to Route 53 with an A record. Keep it that
way for now
Generate a certificate with ACM as described above
Create an ELB as described above as well Now with the DNS first make
a *.domain.com A record to point to your dualstack.
Then delete the original A record that pointed to your ip address
Next make sure you point the A record now to your
dualstack.loadbalancer for your regular domain.com
Next, here was the crucial part for me, make a PTR - Pointer record
to your ip address with domain.com as the name
Viola free certificate will work with Wordpress
Oh, and if your design looks funky or any issues getting the green bar then it's something embeded so start with this plugin, make sure "HTTP_X_FORWARDED_PROTO (e.g. load balancer, reverse proxy, NginX)" is enabled and then move on from there with your typical ssl auditing. https://wordpress.org/plugins/ssl-insecure-content-fixer/11
A lot of cool info for AWS + Wordpress via bitnami and more details on the SSL here: https://community.bitnami.com/t/connecting-amazon-ssl-via-load-balancer-to-bitnami-aws-marketplace-instance/41460/29
Let me know if you have trouble getting started on actually launching the instance and getting wordpress up first. The domain pointing and ssl is one of the last steps.

How to point Amazon DNS service to a specific folder on EC2 server

I feel very dumb already. I have searched for the answer for 2 hours without any success.
I have bought a domain through Amazon - Route 53. It has created 2 hosted zones for me NS and SOA type.
I am unable to figure out how to point a specific domain e.g. example.com to a specific folder on the EC2 server.
Do I need to create that A type hosted zone? If yes, do I just put IP address into value field of that zone? If yes, how then it knows which folder should it pick?
Is there any set up to be done on the actual server(I mean through remote desktop)? Do I need to setup a DNS there? I guess not.
Step 1: Use use route 53 and create an 'A' record which points the domain to the server ip address (you had that part right).
Step 2: In the IIS Admin/Manager tool you 'bind' a particular dnsname to a specific website that you previously setup in IIS.
You need to do both steps.