Support libldns.

We want to avoid hardcoded dependencies on FreeBSD. DNS functions
should have some alternative to FreeBSD specific resolver.