The old code used /tmp/net.$netif.resolv.conf with $netif being randomly chosen. As it is not known which nameserver have which priority, just sort them and deduplicate.