AWS - How to create a generic dns in front of load balancer - amazon-web-services

I have an internal load-balancer in aws and I am able to access it successfully from my office network.
I want to put this behind a generic dns so using Route 53, I created a private hosted zone "domain.com"
and then created A record "project.domain.com" pointing to the lb dns mentioned below:
DNS of internal load balancer -> internal-lb-99999999999999.us-east-1.elb.amazonaws.com/
But now from my office network I tried to access "project.domain.com" and it did not work. AM I missing something?

For the setup i have used in the past we do not have the http:// part in the value of the A record in DNS just the load balancer DNS.
Also have you validated that your VPC has DNS resolution enabled?

Related

Use Elastic IP for ALB

I have set ALB with fargate, currently I can access to ALB with dns name like this
myapp-LoadB-FDEWFSOAQXD4-f18c75dd4249a10d.elb.ap-northeast-1.amazonaws.com
However it is said this DNS could be changed.
So I want to give this the Elastic IP
I have experienced connection EC2 and Elastic IP.
In Elasitc IP panel I can choose instance.
However, there is not ALB is listed.
How can I set Elastic IP to ALB ? or am I wrong basically?
Two options here, depending on what kind of direction you are heading:
If you do not like the default DNS name
You can create a DNS record that will point to your load balancer. This means that people would be able to surf to your website by using www.whitebear.com instead of myapp-LoadB-FDEWFSOAQXD4-f18c75dd4249a10d.elb.ap-northeast-1.amazonaws.com
See: Routing traffic to an ELB load balancer - Amazon Route 53
If you really want to attach an ElasticIp to a loadbalancer
There are some use cases where it is really needed to be able to surf to a loadbalancer using a fixed IP. You can achieve this by setting up a Global Accelerator on AWS.
With Global Accelerator, you are provided two global static public IPs that act as a fixed entry point to your application, improving availability.
More information can be found on the AWS Global Accelerator page
If you wish to create a 'friendly' name for an Application Load Balancer, you can create a CNAME record in your Domain and point it to the DNS Name of the Load Balancer.
If you wish to point the Apex of your domain (eg example.com), you can use an Alias in Amazon Route 53 to point to the Application Load Balancer. (It is not normally possible to point a Domain apex to a CNAME record, so the Alias capability of Route 53 will do it for you.)
See: Routing traffic to an ELB load balancer - Amazon Route 53

Replace eleastic ip access to web app hosted on EC2 instance in aws with load balancer

We have a subdomain under our company domain for our application: myapp.company.com.
Few years ago the following setup was done
myapp.company.com points to an elastic IP (done by the company IT)
elastic IP targets an public internet facing EC2 instance
Now I'm trying to find a way to switch that setup so it make use of a classic load balancer.
I created an internet facing classic load balancer
is in the security group of the VPC in which the instance is
targets the instance which is currently reachable through the elastic ip
I'm able visit the web apps on the instance through the load balancer with the public ip defined in
the network interface of the load balancer.
After that, I thought a hosted zone would do the trick of routing the calls to myapp.company.com to the load balancer.
So I created a hosted zone
domain name when creating the hosted zone: myapp.company.com
added an A record which has the load balancer's dns name as alias target
But the load balancer is not used.
If you are going to use Classic Load Balancer, you need to make a note of the string from ELB DNS name (for example, my-load-balancer-1234567890.us-west-2.elb.amazonaws.com). After that, ask your IT support to modify DNS record for myapp.company.com to CNAME which points to ELB:
myapp.company.com CNAME my-load-balancer-1234567890.us-west-2.elb.amazonaws.com
(creating the hosted zone in AWS Route53 will only work after someone (zone owner, so probably IT) delegates authority for your (sub)domain to your AWS name servers, and it is most probably not worth doing just for the sake of one record)

Route 53 + ELB = does not work but seems properly configured

I have HostedZone created by Route53 Registrar, one AWS instance and Elastic Load Balancer. I am able to access my application using load balancer DNS name but not with the domain name. I have created Traffic Policy using my load balancer name (I have simply chosen it from the dropdown list).Once completed I can see it in my Hosted Zone record set as an A traffic policy record.
What I am doing wrong that it does not work? All needed ports are open. I read and read answers from similar question but can't get it work for me..

Getting root to point to AWS ELB without using AWS nameservers

I've set up my application on AWS Elastic Beanstalk. I added a load balancer and pointed a CNAME for 'www' to it. But now I need to get root pointed there too. I can't use Route53 and use AWS nameservers because the client wants to use theirs. How can I get root to my app? Can I redirect the traffic? The tech lead I'm working with suggested setting up a server to do the redirect?
Since AWS ELB's only offer DNS Record (Instead of IPs) you need to use a CNAME mapping. However with DNS, CNAMEs do not allow root domain to point to it. To overcome this AWS has provided Alias Records (Custom implementation to AWS) to point root domain to ELBs.
If your client want to use their nameservers still you can use, AWS Route53 in between to solve this with following steps.
First create a Public Hosted Zone in Route53 for your domain.
Then create a record set inside the Hosted Zone for the root domain to point to the ELB with Type = A - IPv4 Address, Alias = Yes with ELB CNAME as for the Alias value.
In the external domain management service, create a NS record to point the root domain to Route53 nameservers.
Then when the DNS resolution happens, the root DNS query will first go to external nameservers(Managed outside of Route53) and then it will be forwarded to route53 where it will resolve the ELBs IP address and sent back.
You can set up a machine with a single static IP address that does nothing but redirect requests to the www host. Then you can put an A record on the bare domain at the apex of the DNS zone pointing to that machine.
There is at least one service, http://wwwizer.com/naked-domain-redirect, that will do this for you. (I'm not affiliated with this service, but it appears to do what it claims and will serve your purpose. There are probably others like it.)
Ideally, though, you'd persuade your client to change the authoritative nameservers to point to a Route 53 hosted zone that you create for them. They are still the registrant and "owner" of their domain, and can take control back from you by simply changing the nameservers to something else.
I generally persuade clients with the explanation that our load balancer infrastructure is integrated with the DNS servers so that if a balancer node fails, or we need to add or scale up capacity, or experience a traffic surge or DDoS event, the load balancer system will automatically update the DNS records for their domain to try to mitigate the issue and keep the site up. To do otherwise is to do things in such a way that removes those layers of redundancy.
Ideally, you can set up a apache server with a static IP, and install a free SSL certificate on that web server at first.
Second you need to redirect your root domain name request to AWS ELB.
Then go to your DNS management and set up your apex point to the server you created.
It is now possible to setup a Network Load Balancer and allocate one or more Elastic IP Addresses to it (one per Availability Zone). The Network Load Balancer can have an Application Load Balancer as a target. The Application Load Balancer would target the Elastic Beanstalk. An A record can then be created in the external DNS for each Elastic IP Address of the Network Load Balancer.
If you don't need the functionality that the Application Load Balancer provides, you may be able to target Elastic Beanstalk or whatever application directly from the Network Load Balancer.
Since AWS ELB's only offer DNS Record (Instead of IPs) you need to use a CNAME mapping. However with DNS, CNAMEs do not allow root domain to point to it. To overcome this AWS has provided Alias Records (Custom implementation to AWS) to point root domain to ELBs.
If your client want to use their nameservers still you can use, AWS Route53 in between to solve this with following steps.
First create a Public Hosted Zone in Route53 for your domain.
Then create a record set inside the Hosted Zone for the root domain to point to the ELB with Type = A - IPv4 Address, Alias = Yes with ELB CNAME as for the Alias value.

AWS Route 53 DNS alias for internal load balancer

I've setup an internal load balancer for my SQL read servers in EC2, but I can't figure out how to point DNS at it. I have a private hosted zone in Route 53. When I attempt to setup an ALIAS record to the LB, the internal load balancer does not appear in the dropdown, though all the public LBs do, which leads me to believe I'm going about this the wrong way. None of my Googling has led me to any information specific to private load balancers, so maybe it's just not possible and I have to use the long AWS domain name?
My experience : I was trying to create single HTTPS contact point for my application, so I tried setting up internal load-balancer hoping when I point it to A Record in Route 53 it would work with just A Record url.
To answer your question :
Internal Load Balancers do list in Load Balancer listing for Route 53.
You can not use A Record url to publicly point to internal load-balancer unless you are actually connected to VPC