-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Greetings,
it might be interesting to provide a new tool: a frontend for the getaddrinfo function.
There are copious amounts of DNS clients out there -- nslookup, dig, drill and host, to name a few -- but mechanisms such as /etc/nsswitch.conf allow to completely change a system's name resolution behavior, prioritizing other mechanisms over DNS or replacing it outright, to say nothing of caching behavior, and most programs do not perform DNS resolution themselves, relying on functionality provided by the C library instead. This creates a discrepancy between the information provided by the DNS clients and that provided by the C library.
As I understand it, the C functions getaddrinfo and getnameinfo are the most flexible interfaces to the C library's name resolution facility, with older functions such as gethostbyname and gethostbyaddr accessing the same data but providing fewer options to influence the lookup. To my knowledge, while getaddrinfo and getnameinfo are absolutely great for C programs (as well as programs in other programming languages that have access to the C library), there is currently no executable whose primary purpose is querying this name resolution facility, and I think it might be a good idea to introduce one.
The most important purpose of this tool would be troubleshooting, e.g. identifying discrepancies between DNS and whatever data the system resolver is using.
What's the uutils team's opinion on this?