0

I have a zone in Route 53; let's call it example.com. I have three A records in that zone:

server1.example.com  --> elastic_ip_1
server2.example.com  --> elastic_ip_2
server3.example.com  --> elastic_ip_3

I want to add a new record to Route 53 with the name server.example.com so that a DNS lookup of server.example.com will return one of the three Elastic IP's listed above, chosen randomly and with equal probability.

How do I add this new record?

(Note: these services are UDP-based, so we cannot use the Elastic Load Balancer.)

UPDATE: I would prefer not to use an A record with multiple IP addresses as this would have to be updated each time one of the underlying A records changes.

  • Perhaps you need to edit your question to include more big picture. It seems like you're trying to manually create a load balancer in a weird way. You can do this using ELB or Route53. – Tim Jun 6 '17 at 19:39
  • Read this and this. Short version: Route53 or Nginx can do it. The reason ELB can't do UDP is it's based on HAProxy, which doesn't support UDP. – Tim Jun 6 '17 at 20:02
0

Create a weighted resource record set, giving all the records the same weight.

Each record would be of type A, but with Alias set to Yes. The alias target for each of the new records would be one of the existing A records, each of which (in this case) must be another record that is already present, and in the same hosted zone.

This configuration also allows you to use Route 53 health checks to evaluate the health of each record's target, and exclude any unhealthy resources from the responses Route 53 will return.

http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-weighted-alias.html

2

Just add all three of those IPs to the A record, like this: enter image description here

  • Is there any way to do this where you instead put in the names of the A records of the Elastic IPs: server1.example.com, server2.example.com, server3.example.com. This way if the IP address of server1.example.com changes in the future, you would not have to worry about updating the record for server.example.com (subject to TTL). – user35042 Jun 6 '17 at 19:24
  • You would do that with a CNAME RR but you can have only one of those RRs. – Mark Wagner Jun 6 '17 at 20:51
0

So , you maybe use PowerShell

Add-DnsServerResourceRecordA –Name example –IPv4Address ip_address –ZoneName your_domain

Resolve-DnsName example+your_domain

0

I think this was what Michael - sqlbot was getting at; here are the details that worked for me.

I created three "alias" A records each with the same name: server.example.com:

Name                Type  Value                      Weight  Set ID
server.example.com  A     ALIAS server1.example.com  10      wwr1
server.example.com  A     ALIAS server2.example.com  10      wwr2
server.example.com  A     ALIAS server3.example.com  10      wwr3

There were two things that confused me: the records all use the same name (i.e., server.example.com), and that the Set ID's are all different.

(This post was also helpful: https://forums.aws.amazon.com/thread.jspa?threadID=126148)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.