2

I am using Amazon's Route 53 to set up zones for a domain. I have multiple A Records set up as an Alias to a bunch of targets. These aliases have a Weighted routing policy.

They look something as follows:

A     foo.mydomain.com     ALIAS srv1.mydomain.com
A     foo.mydomain.com     ALIAS srv2.mydomain.com
A     foo.mydomain.com     ALIAS srv3.mydomain.com    

I am looking for a Unix call I can make with foo.mydomain.com as the parameters and returns me a list of all the three hostnames above as the result.

Is this possible through (without using the Amazon SDK)?

Thank you

Law29
  • 3,507
  • 1
  • 15
  • 28
ButterL
  • 21
  • 1
  • Your question title says IP addresses, but your question itself says "returns me a list of all the three hostnames." What do you want? Hostnames or IP addresses? – Michael - sqlbot Apr 15 '16 at 01:21
  • @Michael-sqlbot sorry, hostname. Either way, if I have any of them I can translate them into another – ButterL Apr 15 '16 at 03:29

1 Answers1

2

In short, the answer is no. You've configured it in a way that it's not possible through a DNS query to get all the possible records in one request.

Either dig or nslookup should return the IP adresses... however, it's not likely to return more than one at a time if you are using a weighted policy -- that is the point, to return them at certain frequencies -- some more than others if they weights are different.

There is not a way to query for the hostnames, of course, because these are aliases. That's the point of an alias, not to return the target, but rather the record that would have been returned had the target been directly requested.

The aws-cli's aws route53 list-resource-record-sets should be able to be used to query this, but that's not a "Unix" command that's installed on a system by default.

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