I guess I'm missing something obvious, but resolv_wrapper only deals with the traditional libresolv interface, not with modern POSIX getaddrinfo/getnameinfo. It's the first time I actually look into name resolving in Samba and the implemenatation of resolv_wrapper, so I guess I'm missing a key point?
getaddrinfo() is handled by nss_wrapper via a hosts file. resolv_wrapper only wraps the functions provided by libresolv(). However nss_wrapper still misses support for nss hosts modules. Once we have that we could write a module which uses resolv_wrappre :-)
D'oh! Thanks, I knew I was missing something. :) I was git grepping for getaddrinfo but somehow I must have missed it's presence in nss_wrapper.