Create IP address for load balancer? [duplicate] - amazon-web-services

I had a question about using the URL in my Load Balancer - and using it as the A Record for my DNS entry via GoDaddy...GoDaddy doesn't allow a URL, and insists on the A Record being an IP address and no other format. But I don't see this option available in the Load Balancer I created, only a URL.
What I have so far is this..
I've created a Load Balancer successfully using both HTTP and HTTPS, along with the RapidSSL cert I purchased and imported.
When I open my new Load Balancer item in EC2 dashboard, under the Description tab, I see an auto-generated URL next to DNS Name: http://ACThttp-617756314.us-east-2.elb.amazonaws.com (A record)
The above URL works fine in my browser. I went to plug this into GoDaddy'a A record in the DNS settings --- but apparently GoDaddy only allows an IP address to be used as an A Record...and not a URL like the one generated by EC2. I find this confusing since it literally says "A Record" next to this generated URL in my Load Balancer.
Does this mean I need to generate an IP Address inEC2 dashboard, so that I can use it in GoDaddy DNS settings? I'm guessing this is done via Route53...or could I skip this altogether and still find a way to connect my new Load Balancer to my DNS A record some other way?
However this is done, any help would be appreciated. If Route53, what are the exact steps I need to take? Or any other solutions, as much detail you could provide would be so so so helpful.
I've done this a few times successfully in the past, but it was a while ago and I can't recall how I connected them to the DNS properly.
Thanks!

You should use a CNAME record (not an A record).
A CNAME record points to another DNS name, whereas an A record points to an IP address.
Load Balancers should always be addressed by their DNS Name, so use a CNAME record.

Related

AWS Load Balancer & BlueHost

Currently my domain name adthrone.com is pointed to ec2 instance ip 5x.xx.xx.xx
That domain result is HTTP
So I created a load balancer with this link https://adthrone-loadbalancer-1188159040.us-west-2.elb.amazonaws.com/
Now, Is that even possible to change the DNS pointing of
5x.xx.xx.xx
to this
https://adthrone-loadbalancer-1188159040.us-west-2.elb.amazonaws.com/
I tried to contact my DNS Provider BlueHost. But they seems do not want to change it. Because on my bluehost screen. If I manually change it. From EC2 IP to Load Balancer there is an error that the link is not applicable.
The load balancer is working fine, it has only mixed content that needed to fix. But the issue is that possible to change the DNS pointing from IP to Link?
Use a CNAME record instead. You can put adthrone-loadbalancer-1188159040.us-west-2.elb.amazonaws.com in the value field of the CNAME record.

Google Cloud Load Balancer IP Not Redirecting

Good evening, I am currently trying to set up a load balancer for my server, I successfully set everything up, however when I go to google domains to set ip record I get the following error "mysite.com unexpectedly closed the connection."
http://prntscr.com/npm04o
http://prntscr.com/npm0ot
Also when i type the ip manually in the browser I get the same error. However when I set my ip record to a VM machine ip that comes from my instance group the load balancer ip starts to redirect to my site. I would like to get the load balancer ip to work with my google domain records.
Picture of configuration
http://prntscr.com/npm3ye
I think you are connecting to the load balancer using HTTPS. You do not have a front-end configured for HTTPS. Specify http:// and try again. If this is not the case, then go to Stackdriver and check the logs for your HTTP(s) Load Balancer.
Note: You have not provided enough information in your question. You need to provide the frontent, backend and healthcheck configurations.
Once you have everything working, your DNS resource record TTL should be longer than 1 minute - clients will constantly have to resolve your DNS names. Using a CNAME instead of A record adds another lookup. Use an A record instead.

Subdomain not mapping to load balancer backend service in Google Cloud Compute Engine

I've created a Cloud DNS Zone for example.com and pointed it's A record to Load Balancer's Static IP.
In the Load balancer, I have configured foo.example.com to point to the foo-backend-service:
When I navigate to foo.example.com, it doesn't work.
Do I need to explicitly create an A record entry for foo.example.com in the Cloud DNS Zone and point that to the Load Balancer's Static IP.
The domain names example.com and foo.example.com are different DNS names. Therefore you need to create DNS resource records for each one.
If you plan to keep example.com and foo.example.com pointing to the same load balancer, use a CNAME mapping foo.example.com to example.com. Otherwise create an A record with IP addresses pointing to the load balancer.
In your question you are showing your backend rules. Unless you need to specify rules for mapping urls, delete the extra entries and just use the default rule (I cannot see the right hand side so I don't know what you are trying to accomplish). I think you were trying to map foo.example.com to example.com which is not usually correct in your case.

Using Cloudflare with Amazon EC2 and load balancers

I am running my website on AWS.
I have one load balancer for my two web servers. My load balancer doesn't have a static IP address, it has a domain name.
I want my traffic to come only via the load balancer. I am using Cloudflare's DNS instead of Route 53, because that's what the Cloudflare instructions said.
I cannot add the load balancer's IP as an A record because it is dynamic and cannot be added through Cloudflare's DNS panel (Not like Route 53). Help me I am stuck in this situation. No solution is offered by Cloudflare so far.
Has anyone faced the same issue?
You can set your Cloudflare record as a CNAME alias of your ELB's A record
See:
https://support.cloudflare.com/hc/en-us/articles/200168986-How-do-I-add-a-Amazon-ELB-Elastic-Load-Balancing-record-to-CloudFlare-
I suggest to manage your domain DNS with CloudFlare.
Add a CNAME record for your subdomain demo which points to that IP.
On CloudFlare Console go to Crypto > Origin Certificates. Create a new one with RSA, then import it to AWS Certificate Manager at us-east-1. For the certificate chain use this.
Be sure that Always use HTTPS in Crypto tab is on.
After some minutes you should be using your domain pointing to AWS with HTTPS working fine.
That's what I did to make a subdomain to work with an AWS API endpoint with SSL.
I decided like this:
I created in the cloudflare, in the DNS table, two CNAME records that point to the dns name of the load balancer generated in aws.
The first record created must contain in the "Name" field, the value "www" with the "content" field pointing to the url of the load balancer in aws. The second record, on the other hand, points to root, containing the value "#" in the "Name" field and "Content" pointing to the same load balancer server in "aws".
See the images below for a better understanding.
I've tried with the Cname record with target as Load Balancer DNS name, but the website is not secured.
If you need static IP for your Load Balancer then use Global Accelerator. It will provide you a static IP. After that create an A record with domain name in cloud flare and content with your Static IP provided by Global Accelerator and the Proxy status must be Proxied.

A(Host) Records with AWS Load Balancer

I have a question regarding AWS Load Balancers.
I can point my CNAME www to my load balancer's DNS perfectly and i know it will always work, BUT I also need to point the # record to the load balancer so people can access mysite.com instead of www.mysite.com and hit the loadbalancer.
The problem is that the A Records have to point an IP Address so i can't point to the DNS and the IP of the load balancer keeps changing so mysite.com stops working.
Can anyone recommend me a work around for this?
Here are the steps.
Click create record set
For zone apex record just leave the name field blank
Select the type of alias you want to make A or AAAA (all steps after this are the same for both types)
Select the yes radio button.
Open the EC2 console in another tab and navigate to the list of your load balancers.
Click on the load balancer and look at the description tab in the pane below the list. Sample output below
You need a web server that does a redirect instead. i.e. you want to send a 301 "Moved Permanently" from the web server that mysite.com points to, redirecting to www.mysite.com. Then you CNAME www.mysite.com over to Amazon.
Some DNS hosting providers will do this for you, I think GoDaddy does. Otherwise you need to set up a web server you can configure to do this.
The Apache configuration in .htaccess could be for example:
RewriteEngine on
RewriteCond %{HTTP_HOST} mysite.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=permanent]
If you have a generic Apache-hosting site that supports .htaccess then you could do that.
Anyway what you're looking for is a redirect.
Technically, it can't be done. You can only refer to an Amazon load balancer using a CNAME and it breaks DNS rules to assign a CNAME to the root of the domain because of issues this causes with MX records.
That said, some DNS provider do allow you to do this, Amazon's route 53 doesn't, but Zoneedit allows it (with a warning). If you don't need your email to work for that domain, this is a solution. If you do need email, mine did happen to work using Zoneedit, but the DNS rules says you can't rely on this.
Edit: After my post Amazon added the ability to map the root of a domain (a.k.a. the zone apex) to a load balancer using Route 53. See this blog post.
As David points out, you can't do it and still remain within DNS RFC. You could just build a small no load balanced instance somewhere that just redirecs mysite.com -> www.mysite.com. Not a totally elegant solution, but a work around..
Amazon now has functionality in Route53 that provides a mechanism for binding A records to ELBs: http://www.allthingsdistributed.com/2011/05/aws_ipv6.html
You do NOT need a redirect, and yes it CAN be done. It's just not in the normal mode of working with DNS, so many people aren't comfortable using zone apexes with ELB aliases yet.
See the links given in other answers here, especially https://serverfault.com/questions/342904/how-do-you-create-a-zone-apex-alias-that-points-to-a-elastic-load-balancer-in-th
Amazon has added a special alias option in their route 53 DNS service. You can point an A record as an alias to the load balancer dns. I ran into this same problem because I host my own DNS servers using Bind 9. I didn't want to use the CNAME with redirect solution. The route 53 solution is better and Amazon is great at propagating DNS info across the globe.
Here is an explanation of how to use route 53 with the special alias record for elastic load balancers.
https://serverfault.com/questions/342904/how-do-you-create-a-zone-apex-alias-that-points-to-a-elastic-load-balancer-in-th
The redirect from DNS service provider didn't work for me.
I decided to give up the use of load balancer (from the beginning i created it only to try to hack the mentioned certificate problem). If you must use LB read the opt #2 bellow i didn't try it but i think it's should work.
Opt #1 (without LB)
Take the certificate you got from the trusted issuer and install it directly on the server. Give redirect order from the server (http to https) it will handle www as well.
I used image of bitnami so i could use bncert-tool for that.
Opt #2 (with LB you should have certificate body and private key)
You should do Opt #1 and go to certificate manager at AWS-> import certificate and then use that certificate with your LB that way you have the same certificate with both cases
I never tried opt #2
Good luck
For someone who is not using Amazon Route 53 it seems like a recommended solution is to create a Network Load Balancer which then points to an Application Load Balancer, which then points to our EC2 instances.
The Network Load Balancer has a static IP Address, which is what you want.
Source: https://aws.amazon.com/premiumsupport/knowledge-center/alb-static-ip/