/etc/hosts doesn't support round robin but you can write a simple bash script to sed replace an entry tagged with a #RoundRobin comment (or any other tag you wish to use, just reflect it in the grep line in the script).
#!/bin/bash
fqdnips=( $(nslookup sub.domain.com|grep Address:|awk -F\ '{ print $2 }'|grep -v '#') )
new=`printf "${fqdnips[@]}"`
old=`grep "#RoundRobin" /etc/hosts|awk -F\ '{ print $1 }'`
sed -i "s/$old/$new/g" /etc/hosts
The above script grabs the output of nslookup for sub.domain.com and stores it in an array. It then prints the top most value to $new and grabs the existing value for tag #RoundRobin assigned in /etc/hosts ... lastly, it performs a sed replace
/etc/hosts file entry would look like this
127.0.0.1 localhost
::1 localhost
11.12.13.14 sub.domain.com #RoundRobin
Lastly, place this script in the root's crontab to run every hour or so and you'll now have an /etc/host round-robin.
This is particularly useful if you have a coded page that is pulling some data from an API and the DNS lookup for the API server is causing a lot of hang time in the page's script execution... resulting in high cpu consumption for what would otherwise appear to be a simple page. To avoid the costly DNS lookup (particularly if your site is doing hundreds of them per minute do to heavy traffic), you should use /etc/hosts to resolve the FQDN of the remote API server. This will dramatically reduce the CPU usage for pulling the API data and generating the page.