--- ./source4/libcli/resolve/resolve.c.orig 2012-10-02 04:24:47.000000000 -0400 +++ ./source4/libcli/resolve/resolve.c 2013-02-13 01:20:32.000000000 -0500 @@ -160,6 +160,16 @@ if (composite_nomem(state, c)) return c; c->private_data = state; +#ifdef FREEBSD + /* Work-around for FreeBSD resolver bug; FreeBSD's resolver fails + * on records containing the non-RFC-compliant '_'. A patch for FreeBSD + * is being tracked here: + * http://www.freebsd.org/cgi/query-pr.cgi?pr=176093 */ + if (strchr(name->name, '_')) { + flags |= RESOLVE_NAME_FLAG_FORCE_DNS; + } +#endif + state->flags = flags; state->port = port;