I'm not entirely sure what this is about. Are you saying the list of backends is dynamic and retrieved from DNS? Why would you do this? Why are the backends changing so frequently? This seems like a major design issue. Why not have one backend that's anycasted with equal priority and you can pop backends in and out as you please?
Also, why wouldn't you just solve this with SRV records? Just patch Varnish to support SRV properly and magic you get everything you ever wanted including failover and priorities. That's probably a more sane request.