2 ms·
To use a single third party utility like dig that would retrieve entries from both /etc/hosts and from zone files, one could use a program like pdns_recursor wi
by 1vuio0pswjnm7 6y ago
To use a single third party utility like dig that would retrieve entries from both /etc/hosts and from zone files, one could use a program like pdns_recursor with the "--export-etc-hosts=on" option.
https://doc.powerdns.com/recursor/manpages/pdns_recursor.1.html https://doc.powerdns.com/recursor/manpages/pdns_recursor.1.h...
Assuming for example, one had HOSTS entries
127.0.0.1 localhost
93.184.216.34 example.com
pdns_recursor is listening on 127.0.0.1 and /etc/resolv.conf contains namserver 127.0.0.1, then
dig ns example.com
should return "localhost" as the NS RR for example.com so we know the A RR came from /etc/hosts not a.iana-servers.net
Additionally, adding the "--trace=on" option will output debugging info that will tell whether the answer came from "local auth storage", e.g., /etc/hosts