Global Accelerator: Any reason not to use the IP address directly?

I have a multi region setup with NLBs in each region behind a Global Accelerator. One of the services I use to automatically create DNS entries for needed hosts does not yet know how to create an A record pointing to a Global Accelerator alias/domain. It can only do a CNAME record to an IP address.

In my limited knowledge of Route53 and A records vs CNAMEs, is that an A record in Route53 provides some sort of benefit in increased host resolution compared to a CNAME, so there is this aspect of the question and also, would there be any reason I should not be referencing the IP address of the GA and instead use the DNS name? I know that GA gives you two IP address, and I would only ever be referencing the one, so I wasn’t sure if always using just one of the IP addresses (such as HA, fail over, etc) was a good thing, vs using the provided DNS name which I’m guessing acts as somewhat of a load balancer across those two IP addresses.

Any feedback on this would be appreciated.


Related discussions:

Just using one IP address would mean you will lose on HA. If you have to use IPs, then your application should do some conditional logic to try both the IPs. DNS does this automatically with health check.

Hard coding IP addresses in general is the sort of thing that doesn’t directly cause any trouble, except that there is a million reasons you’d need to change IP addresses or lose control of an IP address or need to use some service between the IP and hand rolling a system to manage that is worse than the existing extremely robust methods that exist for managing pointing things at IP addresses over a network.

…is that an A record in Route53 provides some sort of benefit in increased host resolution compared to a CNAME…

can you explain your understanding of what you posted here?

A record values are IP addresses.
CNAME record values are other DNS records.

I don’t completely understand the scenario so sorry this is not a complete answer. A small bit of advise is to consider global accelerator LB works on the data plane and not the control plane. Meaning if your system needs to create records in order to operate then if the control plane fails in US-East-1 Route53 you are SOL (no matter what region your workload is in). Check reliability white paper on global services and control vs data plane.

In short I stay far away from any anti patterns when it comes to Global Accelerator HA designs.

Sorry, I mean to say “increased resolution speed”. It is my understanding that an “A record” is a non standard DNS concept only in Route53. It also means they won’t charge you for DNS queries.

A and CNAME records are standard DNS record types as defined by RFC 1035.

It sounds like you may be referring to an ALIAS record which is a non-standard CNAME record that can only have specific AWS services resources as target values.

Ah, sorry, that’s right. it’s the Alias part I was referring to.

Thousands of hostnames can be hosted on a single ip address. Without the host header in the request the server won’t know which responses to return.

In Route53 you can point an A Record to an AWS resource as an alias. That way you can point it to a load balancer or cloudfront distribution that typically only has a domain name, not a fixed IP address like A records are fixed to. Under the hood AWS manages the IP address management of it.

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html

This clearly cannot be how NLBs or Global Accelerator work since you can host workloads that don’t use HTTP and have no concept of host headers.

That’s true for HTTP(S) - your Cloudfront distribution or S3 bucket will potentially be using the same IP address as mine and thousands of others, with only the Host header or SSL/TLS server name (SMI) to tell them apart - but Global Accelerator and NLB support non-HTTP protocols and give you dedicated IP addresses to do it. (For a price, of course!)

DNS does this automatically with health check.

DNS is DNS. It doesn’t check health. Do you mean Route 53?

Yes, you’re right. Route53

I don’t know if an ALIAS resolves faster than a CNAME in Route 53, unless you mean the fact that an extra lookup is required for a CNAME. First to get the CNAME, then to lookup whatever domain the CNAME points to. It might be the case that Route 53 gives this back when the CNAME is requested because as it happens that’s something some DNS providers do. So that might mean there’s no overhead in using a CNAME in this case at all.

I don’t actually understand your question to be quite honest. You only want to use one of the two GA IP addresses for reasons that you have not made clear (why not just use both if you’re going to abstract them away in DNS anyway?), and the solutions for this that you propose are ALIAS records and CNAME records, both of which use both IP addresses.

Honestly if I were you I’d spend some time looking into what an A record and a CNAME record are, and then checking the AWS documentation for what an ALIAS record is, hopefully making things fall into place for you.

The only thing this saves is the lookup latency when the result isn’t already cached. This depends on how latency sensitive your workload is, but for most, this is negligible. Global accelerator gives you an anycast IP that routes to the closest PoP and then into the AWS network. Very little reason to use the IP directly, but in terms of latency, your results probably at p99 and under are going to be the same (you should empirically validate these statements). No explicit downside to using the IP directly, unless you’re doing HTTPS, then you need to use the DNS name so your request matches what’s on the certificate.

They’re already resolved in most DNS implementations. The client doesn’t need to directly look up each cname one at a time

Do you have any info on your business process/what exactly you are trying to achieve?

A lot of the answers here already are correct at some level but seem to miss your question and lack knowledge in how GA works.

What I’m hearing you say is you have tooling that only supports A records and you are already using GA and you want to know if you can just use one of the Global Accelerator (GA) IPs to avoid having to change or work around the tooling, and if there are any downsides?

That seems fine. Preferably you would include both IPs so if one has trouble (eg. bad route advertisement blackholes it) the other will still be enough for many, but not all, clients to succeed. Your tooling may be able to generate multiple A records, one for each IP. They will then be client side load balanced, which is fine because they are both GA IPs.

You need to be very careful not to delete your GA in AWS as then the IPs may be lost unless they are “bring your own” (BYO), but that applies if you use a cname as well. In both cases, you would need to update the DNS to point to the new GA.

Does that answer your question?