I have a file of hostnames (several hundred) that need to be checked against a DNS server to verify that they're valid, should I use a resolver library for this, or would calling the nslookup program suffice? I've read the man page on nslookup and it says nothing about return values, so that could be interesting.
I wasn't aware of nslookup being available... that's nifty.
I probably wouldn't use it though... I would personally use a library as you suggest. I'm unsure of what you're wanting to do exactly (aside from probably search for IP's associated with a hostname). Either way, I cannot picture it being too difficult in C/++.
After some research, I'm thinking a library would be best. I'm checking this file of host names for validity. It seems that this file is the last to get updated when a name change happens (we also keep them in our DNS server, and snmp server) but it is the main source when someone needs to know a name. So I'm trying to automate the process a bit by seeing which names are no longer valid, and making note of that so I can fix the issue.
I haven't ever used BSD sockets, I'm only slightly familiar with the API. The message sent out would have to be a standard message as these network do not support any sort of custom software embedded. I know they respond to pings, SSHv2 (v1 on a couple) and telnet on some of the really old stuff. I was thinking nslookup (or something similar) would be ideal because other than ping, the devices could vary on what they support and querying a name server would be a little better than sending out packets literally to every device.