How to test weighted DNS A records
On Route53 you can configure record sets with associated weights as A records.
weighted a records
To test that the above weights translate in the right resolutions, we need to start from the authoritative server. Here’s a bit of commands to test this (in fish shell):
> set authoritative (string split " " -- (dig octopus.energy NS +short)) > for i in (seq 1 100) dig octopus.energy A @$authoritative +short >> auth_resolutions.txt end > cat auth_resolutions.txt | sort | uniq -c 99 184.108.40.206 1 220.127.116.11 99 18.104.22.168 1 22.214.171.124
The output shows it as working. The IPs are 4 because of the number of AZs we use.
DNS records are propagated to recursive resolvers with a TTL. Ours is set to 60 seconds, to make sure we are able to propagate weighting changes as quickly as possible.