It isn't really an answer to your question, but new code really should
be using getaddrinfo() rather than gethostbyname().
As for the rest of it, perhaps some system call tracing would help -
run your application under strace and look at the system calls being
made - that may help tell you want is going-on/wrong.
If I were to guess, it would be that gethostbyname() and the resolver
libraries were caching bogus DNS server information - if DHCP didn't
provide an IP address to the NIC, it likely didn't provide DNS server
information to go into /etc/resolv.conf either.
rick jones
--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway...

feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...