2

I have created an ELB for my 2 dev instances. My domain name is example.com, which is an A record to an Elastic IP for an EC2 instance. I'm trying to create a subdomain record dev.example.com, which is an ALIAS record to the ELB. My ELB DNS name is dev-elb-222222222.ap-southeast-1.elb.amazonaws.com.

When I hit the ELB DNS directly from the browser, the data is served perfectly. But when I go to dev.example.com, I get the error that DNS address cannot be found.

It has already been an hour since creating the record set for dev.example.com. Here are the values of the record set:

Name: dev.example.com

Type: A - IPv4 Address

Alias Target: dualstack.dev-elb-222222222.ap-southeast-1.elb.amazonaws.com.

Alias Hosted Zone ID: Z1LMS91P8CMLE5

Routing Policy: Simple

Evaluate Target Health: No

Can someone please tell me where I'm going wrong?

chaudharyp
  • 3,394
  • 3
  • 26
  • 42
  • Your settings seem fine. What happens if you resolve the domain name (eg `ping dev.example.com`)? – John Rotenstein May 12 '16 at 04:26
  • Thanks for your help. I found out the issue. The issue was that my DNS zone file was hosted on GoDaddy and I was trying to make the change in Route 53. – chaudharyp May 12 '16 at 08:41
  • In my case it was because I had my ELB service running in a VPC and so the alias was set in a private hosted zone - out of the reach of the public zone until i associated the corresponding VPC to it – arielnmz May 21 '20 at 23:06

2 Answers2

1

In your case, it is better to add a Record Set type CNAME, the Name is dev.example.com, the value is the ELB DNS name.

Please look at this article: http://hanoian.com/content/index.php/21-aws-setup-elb-and-route53-to-handle-ssl-certificate-and-www

Châu Hồng Lĩnh
  • 1,986
  • 1
  • 20
  • 23
0

ALIAS records are basically used for two reasons:

  1. Make it possible to alias the root domain to another service.
  2. Make it possible to use an alias system that can coexist with other data.

Alias records are possible in Route 53 because Route 53 has the internal knowledge of how the query should be answered; a third party DNS server does not have access to that same information.

So, you can try creating a CNAME for this. See Choosing Between Alias and Non-Alias Resource Record Sets for more information on the visibility of the record.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
RaviTezu
  • 3,047
  • 19
  • 26
  • Alias records pointing to an ELB are better from a pricing perspective: "Queries to Alias records that are mapped to Elastic Load Balancers, Amazon CloudFront distributions, AWS Elastic Beanstalk environments, and Amazon S3 website buckets are free." – John Rotenstein May 12 '16 at 04:13
  • Thanks for your help. I found out the issue. The issue was that my DNS zone file was hosted on GoDaddy and I was trying to make the change in Route 53. – chaudharyp May 12 '16 at 08:40
  • It is possible to point GoDaddy to Route53 and do all your configurations there. See: [Migrating DNS Service for an Existing Domain to Amazon Route 53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html) – John Rotenstein May 13 '16 at 04:56