1

I have example.com behind ALB

Since I'm using external DNS service other than route53,

I created a CNAME in my DNS service such as

some-unique-name.ap-northeast-2.elb.amazonaws.com pointing to example.com

It works fine.

But then, I need to add TXT record for example.com for site verification (google-site-verification=some-unique-text)

I waited 2 days, and dig gives me CNAME record only.
And I read it's a bad practice to create a CNAME record for root/apex domain (such as example.com) because it hides other records other than CNAME

I think this is what's happening to me.

How do I connect example.com to aws ALB and have a site verification as well?

eugene
  • 139
  • 1
  • 9

1 Answers1

1

There isn't a way to do this.

Not only is a CNAME at the zone apex "bad practice," it is a completely invalid configuration that no provider should allow. If any other records in that zone are working, they should not be. This is why Route 53 created the concept of Aliases -- so that Route 53 can do an internal lookup of the alias target and return the answer without violating the protocol.

Your existing provider might offer an appropropriate pseudo-record type or a feature like CloudFlare CNAME Flattening where they transform a value that you appear to be configuring as a CNAME into an proxy lookup for the underlying A record, an external emulation of Route 53's Alias capability -- implemented very differently but providing the same net result.

Otherwise, you need to use Route 53 to have an ALB (or Classic ELB, or NLB, or CloudFront, or S3 bucket, or API Gateway, or Elastic Beanstalk) at the zone apex. If for some reason you want to keep the domain with the current registrar, you can still do that. Create a hosted zone for your domain in Route 53 and use the 4 NS record values that Route 53 assigns to the hosted zone and provide them to your current registrar as the authoritative name servers for your domain. Copy any records you need from the old provider's DNS zone excluding NS and SOA into the Route 53 zone because the old provider's DNS settings will no longer be functional after that conversion.

Michael - sqlbot
  • 21,988
  • 1
  • 57
  • 81