I write or modify programs which perform name resolution and need a good control of the process. So I do not use getaddrinfo(), I go deeper and use res_qu
getaddrinfo()
res_qu
glibc:
res_setservers: no __res_state._u._ext.nsaddrs __res_state._u._ext.nsmap
set the latter to MAXNS+1 according to:
http://sourceware.org/ml/libc-hacker/2002-05/msg00035.html
BSD-libc:
res_setservers: yes __res_state._u._ext.__res_state_ext
Seems messy to me and you'll probably need autoconf.