As part of auditing a RANCID server, I would like to be able to figure out whether it's resolving a particular hostname via /etc/hosts, DNS or some other source. Is there a generic (without me hardcoding the logic and order of my particular
nsswitch.conf) way to do this?
gethostbyname just gives me the result. Do does getent, as far as I can tell, although I can get it to only use file or dns with the
-s option, that still means I am parsing nsswitch.conf to decide which one it would have chosen, or assuming the configuration.