0

I have servers running in AWS Application Load Balancer. The AWS Load Balancer can only be connected to via an A-name (I.e. "prod-LB-us-west-2.elb.amazonaws.com"). A fun catch with AWS laod balancers is: the IP address will not remain consistent. It can (and does) change randomly. So I can't just point the A-record to the Load Balancer's IP.

The PM wants EVERYTHING hitting the domain to go to the correlated port on the Load Balancer: I.e.

example.com:3000 -> prod-LB-us-west-2.elb.amazonaws.com:3000
example.com:3001 -> prod-LB-us-west-2.elb.amazonaws.com:3001

Can this be done with a wildcard'ed cname?

If not, I'm not sure how to forward each name resolution to the Load Balancer.

4
  • 4
    Your examples only differ in the port. What has this to do with DNS? Apr 20, 2017 at 9:54
  • What do you mean with "wildcard'ed cname"? Port numbers are not part of the DNS and as long your CNAME mydomain.co points to prod-LB-us-west-2.elb.amazonaws.com you should be done.
    – Thomas
    Apr 20, 2017 at 10:21
  • Yeah. I know this and I know youre right. I dont thin this is possible in any way, but the tech lead is saying it is. I'm just trying to make sure I'm not missing something :D Bottom line is; he wants anyone who goes to mydomain.co on any port to actually end up on prod-LB-us-west-2.elb.amazonaws.com on that same port. I dont think it can be done that way :D Apr 20, 2017 at 11:03
  • At least not without building a NAT server or something. Apr 20, 2017 at 11:05

1 Answer 1

2

Your tech lead is correct. I don't know what DNS provider you are using but you should be able to use a CNAME record that maps to the FQDN of the ELB. If you are using Route53 you could add an Aliased CNAME record to accomplish the same thing.

Using a CNAME record that maps to the FQDN of the ELB means that even if the IP Address of the ELB changes your connections will still work.

As far as the ports are concerned Thomas is correct this is not a DNS issue. What you need to do is to set up the appropriate listeners that forward requests to the correct target groups. AWS documentation is very useful and has all the configuration information that you need.

http://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .