Help wanted: Linking to libbind9 on Ubuntu Linux

Robert Edmonds edmonds at mycre.ws
Tue Mar 20 19:30:41 UTC 2018


Ronald F. Guilmette wrote:
> Apologies in advance to all.  I am probably just making some
> bonehead mistake or small typo, but...
> 
> Can someone please instruct me as to the proper way to link to
> libbind9 on Ubuntu 14.02 LTS?
> 
> I am porting some code of mine from FreeBSD to this Ubuntu system
> and I'm getting the following unresolved symbols at link time:
> 
>     __res_query
>     __res_mkquery
>     __res_send
> 
> It seems apparent that this is caused by the fact that FreeBSD has
> the resolver routines integrated into libc, whereas Linux systems
> don't.

For glibc versions that are less than about ten years old, these should
be available in libresolv, which is part of glibc. The relevant change
in the glibc changelog is:

2008-08-01  Ulrich Drepper  <drepper at redhat.com>

        [...]
        * resolv/Versions: Export functions from <arpa/nameser.h> from
        libresolv in version GLIBC_2.9.
        [...]

See the resolver(3) manpage, which is probably in the manpages-dev
package on Ubuntu 14.

This is unrelated to libbind9, which is a different API.

-- 
Robert Edmonds


More information about the bind-users mailing list