Issue with Google Cloud Platform(GCP) DNS zones and openshift - google-cloud-platform

I have followed the instructions at https://docs.openshift.com/container-platform/4.11/installing/installing_gcp/installing-gcp-account.html#installation-gcp-dns_installing-gcp-account for setting up an openshift trial.
All steps I managed to get working excpet for DNS steps mentioned.
I created a zone my-new-zone for my subdomain in GCP clusters.mysite.com and pointed DNS NS's to google (ns-cloud-d[1-4].googledomains.com) and I am able to interact with my openshift just fine.
However, in so doing, all of my other DNS entries for mysite.com no longer function.
I tried creating a second zone my-zone in GCP for mysite.com and added those preexisting entries there, but they came up with different GCP DNS NS servers (ns-cloud-a[1-4].googledomains.com).
How can I fix this so that I can access the openshift and also access my original sites?
Note: I can destroy and recreate the openshift cluster as needed at this point, but I need to know the correct steps for getting the DNS right.
Additional clarifications:
Note 1. I thought I had included above but apparently left out this detail: [mysite].com DNS entries were maintained at Dotster.com. When I got to step 6 in the linked instructions, I had to call Dotster.com because I could not understand how to proceed. I was told I could not use separate NS servers for the subdomain and they asked if I wanted to point the NS servers for my domain to the GCP servers indicated. I agreed and they repointed the NS servers. At that point I tried to add my DNS entries to GCP to restore access to my primary sites, and am not understanding how to do so. GCP will not allow me to change the zone name from clusters.[mysite].com to [mysite].com. It looked like all I needed to do was add another zone for [mysite].com, so I did so, not expecting the second zone would use totally different nameservers.
PROBLEM: DNS does not work for primary domain after setting up OpenShift on GCP. My website is down, my email is down, all of my sites are down.
Objective/Goal: Restore DNS service for primary domain entries AND have OpenShift working correctly.
Errors:
$ nslookup www.[mysite].com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
** server can't find www.[mysite].com: SERVFAIL
As for why I created a subdomain, I already had my domain set up at dotster.com. I was following step 2 which says "2. Create a public hosted zone for your domain or subdomain in your GCP project. See Creating public zones in the GCP documentation. Use an appropriate root domain, such as openshiftcorp.com, or subdomain, such as clusters.openshiftcorp.com." And then I called dotster.com when I got to step 6 as I did not know how to proceed at that point. Please see note 1 above.

I suggest to create zone in your root domain, once created, add "A record" using your root domain then add "cname record" for subdomain. Once done, get the nameserver and place it in your domain registrar. Make sure to add other necessary record to the zone that you created in order for other service to work like email. Propagation will take at least 24 to 48 hours depends on DNS server.

Related

Removing custom domain from EC2 instance, and then use domain for Cloud Run app (domain in Route 53)

Per this earlier post, I was able to verify a domain of ours (which is in Route 53) to use as a custom domain with GCPs Cloud Run. However, we are struggling to update the DNS records for this domain now.
Our domain mydomain.com was previously used with an AWS EC2 instance. Our hosted zone in Route 53 for this domain currently has 8 records, of various record types (A, MX, NS, SOA, TXT, CNAME). Before uploading the 8 DNS records for cloud run (GCP gave us 4 A DNS records with ip addresses, and 4 AAAA DNS records with ip addresses, to upload), should I first delete all of the previous records in the hosted zone for this domain? I presume these earlier records are associated with our previous use of the domain with the ec2 instance.
Is it safe to delete all of the previous records from the hosted zone? Or maybe it is better to create a new hosted zone to use with GCP cloud run, and keep this initial hosted zone to remain with the EC2 instance? I am not sure if it is possible to have 2 hosted zones for 1 domain, or not. If only 1 zone is possible, I am not sure if i should delete + re-create a new hosted zone to use with Cloud Run, or try to edit my initial hosted zone (by deleting the old DNS records). I just need to move this custom domain from the EC2 instance to the cloud run app.
Thanks!
EDIT BEFORE BOUNTY: here are the DNS records that Cloud Run is telling me to add to my domain host (true values and domain name changed):
... and here is my Hosted Zone for the domain:
...the top 2 records are the new A and AAAA records that Cloud Run has given me (there was previously 2 A records that I deleted). When trying to create the A records, I actually received an error when I tried to create 4 separate A records, so I've put all 4 IP addresses into a single A record (not sure if this is correct).
Unfortunately, in the GCP /run/domains page, I am still receiving this error / warning message:
I do not plan to use the old AWS EC2 instance with this domain again, so perhaps I should delete all of the old DNS records that are associated with it? However I am not sure which records are safe to remove and which are not... Perhaps creating a new hosted zone is best (as suggested in an answer below)? Currently I am going the route of simply editing my old hosted zone (as was suggested in the comment below).
We have been struggling with this for most of the weekend and could really use some advice on getting this domain off of the EC2 instance and onto the cloud run deployment.
Edit2: I did just update the hosted zone with the cloud run DNS records a few minutes ago, so perhaps I just need to give it time? Again, I am not sure at all...
I will point out two most obvious ways and their pros/cons.
1. Safest way
You can create a new managed zone (GCP's equivalent to AWS hosted zones), create all the needed records for your cloud run app in GCP. Then change at your domain registrar DNS servers that you got from GCP (probably something like ns-cloud-a1.googledomains.com).
This way you will have full working copy (with setting to accomodate GCP's Cloud run) and in case you wanted to go back to AWS quickly you just need to point to AWS DNS servers at your domain registrar.
Cons of this solution are that you will have to pay a little bit more because you will be effectively hosting your domain at two providers (but only GCP will be actively used).
2. Easy way.
Create new managed zone at GCP, point your domain to GCP's DNS servers and delete hosted zone at AWS.
You can also backup your hosted zone in AWS - you can have a look at this blog post how to do it.
In my opinion if you ever plan to go back (or have a backup) of your domain records setup for AWS then first approach is the one to go for. Additional cost is also negligible.
UPDATE
Any changes made in DNS settings (adding & removing records, modyfying) requite usually up to 24 hours to propagate across the Internet.
Even more about DNS records and how to manage them.
If you want to add multiple A records to your managed zone edit your zone, click on "add record set" button, next select A record type (or AAA for IPv6 and type in the address first value, next click "add item" button below and type another etc.
If you prefer to do it using gcloud the here's some documentation how to add records to your zone (domain).

Namecheap Domain not working on AWS EC2 Instance

I am new to AWS and facing this issue for the past few days. So any help will be appreciated :)
I have created an AWS EC2 instance and deployed backend&frontend services on SINGLE INSTANCE that are used in my project.
Backend->Java,Apache tomcat,RDS,Elasti cache
Frontend-> Node
And now created a hosted zone under Route53 to host my Namecheap domain in AWS EC2.
Have checked all configs thrice, and added A type(Value as ec2 IP) and CNAME(Value as domain name e.g. xxyyzz.liv) type variables in the hosted zone including modifying nameservers from hosted zone to the Namecheap DNS settings.
Even after long waiting(of 48 hrs) my domain is not getting live, tried multiple times but no help.
This will be caused by misconfiguration. Perform the following steps to rectify this issue:
Ensure you have not replaced the NS or SOA records in Route 53, these should stay as the values that Route 53 generates. If you have replaced their values, create a new public hosted zone and migrate the records to this (excluding NS or SOA).
Run DIG against your domain for the MX record, either by running DIG NS example.com or by using an online tool such as https://toolbox.googleapps.com/apps/dig/. If you get no results back (returning a SERVFAIL) or incorrect name servers back then you will need to update the name server configuration.
Within your public hosted zone in Route 53 look for the NS record, copy the values (there will be 4 nameservers). Then within namecheap follow these instructions for "Custom DNS". Add each name server from Route 53.
By now running DIG again you should be able to see the records that should have previously been accessible. Depending on the TTL of the previous NS record you might find it takes a few hours/days for the DNS to migrate across, although you can clear the DNS cache on your local network.

How to create a sub domain to point to Cloudfront CDN endpoint using a domain managed outside of AWS

We purchased a domain from GoDaddy, for example, say mycompany.com.
My colleague then moved it to Wix.com to publish our marketing site, which will be available at the mycompany.com url. I need to add a subdomain in AWS, pointing to a Cloudfront CDN endpoint.
To shed more light into the current situation, here is a little more info:
When I check GoDaddy, it shows Nameservers, referencing the Wix servers. For DNS, it says We can't display your DNS information because your Nameservers aren't managed by us.
When I check Wix.com, I see that Managed by Third Party, Connected by DNS and still provides the option to transfer to Wix.
Both Godaddy and Wix provide the option to add a subdomain.
I'd rather do that in AWS.
What is my best option here? Should I transfer the domain to AWS and manage it there? If so, how do I then route traffic from mycompany.com to the marketing site?
Is there a way to keep it as is, but still add a subdomain on the AWS side for example.mycompany.com?
I really regret not registering this domain via AWS in the first place, but lesson learned. Any help would be much appreciated.
I am assuming that your DNS is being hosted via wix.com.
If you want to migrate to Route 53 its not actually too hard. Start by setting up a public hosted zone within Route 53 with the domain name you setup.
Next you would want to perform a zone lookup for all your DNS records, you can use Googles DIG Tool with the ANY option or do this via cli by running dig example.com ANY.
Now that you have all the records you will need to create them within your public hosted zone, follow this tutorial if you need any assistance. Do not add the SOA or NS records.
Now that all records have been migrated get the values from the NS record in your public hosted zone and replace the nameservers within GoDaddy to point at these values.
Your DNS will migrate over whichever period the TTL of your previous NS record is set as. Once this has migrated and it working you can add your CNAME record as you originally wanted to add.

Google Domain and G-Suite with AWS instance

I have been looking around the internet and I have come across a few different ways to link my AWS EC2 instance to my domain name. It looks like I could do it using Route 53 but I am not entirely sure on that process. The other way is to map it from google. These seem like the best instructions I have found for that: link a Google Domain to Amazon ec2 server
The question that I can not seem to find is what about my email address. I pay google so that I can have some email addresses name#mydomain.com. Now these work fine and I have had them up and running for months. But now I want to have my website (it is a web app) point to it. Because currently when you go to mydomain.com it says This site can’t be reached mydomain.com’s server IP address could not be found.
Some help here on how to do this would be great. I am afraid that I am going to set this up incorrectly and then lose access to my gmail account which I cannot have happen.
Your domain's email is configured via MX DNS records. You would point your domain to your EC2 instance by adding A or CNAME DNS records. The two configurations are completely separate. You will not break your current email setup by adding an A or CNAME record that points to the EC2 instance. You simply need to add that record in your DNS settings, wherever your DNS is currently hosted. You don't need to make any changes in your Gmail account configuration, and you don't really need to use Route53 either (although it does add some nice features). You had to configure the MX records somewhere at some point, to setup your G-Suite account for your domain. You just need to go into that same DNS configuration (most likely still hosted at the company where you initially purchased the domain name) and add an additional record.

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.