CloudFront to a public or private Route53 hosted zone - amazon-cloudfront

I have an ALB created with Terraform and a CloudFront Distribution which is so old that it's not managed by Terraform. My ALB was given a random number in the DNS name and I have concerns about entering this ALB DNS as Origin in CloudFront.
So my idea was, to setup a Route53 entry that would be more or less fixed and also managed via Terraform. But I haven't found a way so far that CloudFront will point to my Route53 hosted zone. Therefore I ask if a registered domain is necessary.
Is it possible that a CloudFront Origin points to a Route53 entry without a domain being registered, i.e. only to private or public hosted zone entries?

You seem to be concerned about the longevity of the DNS name of your ALB.
The DNS name of your ALB is static as long as your ALB exists. If you delete it, you'll get a new one, but as long as it stays, it will be static.
So if you don't plan to periodically delete your ALB, I'd be perfectly comfortable using it's DNS name as the origin in CloudFront.
About your DNS questions:
You can also add an ALIAS or CNAME record in a public hosted zone that points to your ALB (or it's DNS name in case of CNAME), which is managed by Terraform.
It has to be a public hosted zone with a real domain, i.e. some zone must be delegated through DNS to Route53.
Remember that you'll have to create a SSL/TLS certificate for this to work.
Afterwards you could set up the custom domain name as the origin in CloudFront.
This requires you to have a (sub-)domain that is delegated to your public hosted zone.
You can't do the same with a private hosted zone though.
CloudFront needs a DNS name it can resolve and since CloudFront is not part of your VPC, it needs a publicly resolvable DNS name, which the private hosted zone doesn't provide.

Related

How to apply custom domain name to azure kubernetes services (AKS) cluster?

I have a AKS cluster with default FQDN name with the suffix of "cloudapp.azure.com". I want to get a domain and apply it to the cluster but am not sure how to apply custom domain to Kubernetes cluster in azure.
Can anyone help me with the steps to apply custom domain name to AKS cluster?
If I understand you correctly, you've already deployed your application on Kubernetes and want to connect it to your custom domain name.
For this purpose you can use NGINX Ingress Controller.
Below I will briefly describe how you can do it on AKS:
First you need to create an ingress controller and ingress resource. For Azure AKS detailed instructions can be found here: create-an-ingress-controller.
Note: By default, the public IP address acquired by NGINX Ingress is lost
if the controller is deleted. I recommend you to
create static public IP address, because it remains if the ingress controller is deleted.
Next identify the public IP address (EXTERNAL-IP) associated with
your NGINX Ingress service that was created in the previous step.
Now you need to create an A DNS record, to point your domain to the cluster.
Additionally you may
want to provide CNAME record, but is isn't mandatory and depends
on your needs.It is possible to create Azure DNS Zone for your
custom domain and then add appropriate record sets to this zone.
Note: Azure DNS is not the domain registrar, you have to configure the
Azure DNS name servers as the correct name servers for
the domain name with the domain name registrar. For more
information, see Delegate a domain to Azure DNS.
Azure won't provide you the DNS names, but it has a service named as DNS zone, where you can register your custom domain ( that you may have from providers like GoDaddy etc ), the externalIP of the ingress or any other load balancer that you see in the AKS clusters can be mapped to this custom domain name in the DNS zone and this will take the traffic to the respective AKS cluster.
Advantage of DNS zone is that, you can enter multiple alias URLs as well and can make them to take traffic to AKS cluster, like
abc.com is your domain ( let's say )
api.abc.com is for mobile applications to communicate with AKS and this can be pointed to same URL via CNames in DNS zone.
You can have multiple options here based on your usecase, refer Azure's documentation on DNS zones for that

Configure custom DNS for Public IP Address

i created VM behide Azure Load Balancer. i want to use custom domain to Load Balance Public IP. for example i want to access url like 'xx.mvg.com' instead Load Balance Public IP from internet. how i can do it?
i tried to did followed reference link 'https://learn.microsoft.com/en-us/azure/dns/dns-custom-domain' but still not working.
Please recommend how to register my domain name i wish, i want map my domain name to my application running on VM behide Azure Load Balancer.
and Azure have service about internet domain registrar?
about your last question - no, Azure have only Azure DNS, which is not a domain registrar, but a DNS as a service.
Easiest way to achieve what you want - assign a dns name to a public ip (called dns label here) and create a CNAME record in your DNS for that DNS name. or just straight up create a A record in your DNS and point it to your public ip.

Can an Azure NIC be pointed to records one created in an Azure DNS zone?

Is there a way to point an Azure NIC to the records one created in an Azure DNS zone?
At present Azure DNS doesn't support private DNS zones, i.e. those only available to your vnet. Also, the DNS servers specified in the "Add DNS server" box needs to be a recursive resolver, Azure DNS is an Authoritative DNS service, i.e. it will only serve answers for the zones it hosts.
We can't add Azure DNS zone to NIC custom DNS. The custom DNS required IP address, we can add the DNS server IP address to it.
For example, we can add 8.8.8.8 to it, also we can add local DNS server IP address to it(need VPN). Or create a Azure windows VM and install DNS role on it, and add this VM ip address to it.
If you want to use Azure DNS zone to manage your records, we can map your own domain name to DNS zone, and add name servers to your domain name(add this by domain name registrar manage webpage).
The following image shows an example DNS query about Azure DNS zone:
If you want to add record to DNS zone, and you want to map your 3rd party domain name map to Azure DNS zone, we can follow those steps in that answer.
Note:
Keep in mind Azure DNS is not the domain registrar, we should buy domain name from domain registrar(like godaddy, register.com).
Update:
If you just want to use domain name in your virtual network, there is no need to buy a domain, we can use AAD DS in our virtual network. Or we can deploy a VM and install DC on it, work as on-prem.
By the way, in the same virtual network, we can ping VM's name by default.

subdomain on route53 private hosted Zone

I have been trying to setup a Private Hosted Zone in route53 with current associated VPCs in eu-west-1 and will soon add more. I have conformed that my VPC has DNS resolution option set to yes and necessary DHCP option sets are also created. I have added a DNS record under the domain.local domain and it works fine. However, the issue comes when I tried to created a sub-damain dev.domain.local and tried to associate with the same VPC. I see the following error
"A conflicting domain is already associated with the given VPC or Delegation Set."
My intention is to have one parent private zone as zorotools.local and several subdomain such as dev.domain.local, staging.domain.local, prod.domain.local etc.
I would then associate ec2 instances with these DNS names.
So, please let me know what mistake I am making and how should I proceed.
Just create records with the remainder of the FQDN filled out. So in this case create "server1.dev" and it will resolve to "server1.dev.domain.local".

Setup domain name on GCE via cloud DNS

We have followed this instruction to use cloud DNS to set up host name of our GCE instance, which external IP is static. But we still cannot look up the domain name of our GCE instance from the internet after waiting several days. Is there anything that we miss when we setup cloud DNS??
Are you using Cloud DNS as the Name Server too?
If yes, please follow the steps here to update your domain registrar's name server setting
https://cloud.google.com/dns/update-name-servers
Is the Cloud DNS name server reflected in your domain registrar's name server setting? What is the dig response for your domain search ?
To set up a domain name on GCE via cloud dns, you need to set up a Cloud DNS managed zone and then setting up Address (A) and Canonical Name (CNAME) records for the domain. Please see below procedure on how to set up Cloud DNS managed zone, A record and CNAME records:
Create a managed public zone [1].
A managed zone is a container for DNS records of the same DNS name suffix. A managed zone has a set of name servers that accept and responds to queries. Create a new managed public zone:
[1] https://cloud.google.com/dns/docs/quickstart#create_a_new_record
Create a new record for A record [2].
[2] https://cloud.google.com/dns/docs/quickstart#create_a_cname_record
Create a CNAME record [3].
The record update will take some time to propagate depending on the time-to-live (TTL) values in your zone. You can verify that the DNS records are working by visiting the domain name and confirming that the domain resolves to your IP address.

Resources