diff --git a/lib/dns.js b/lib/dns.js index 18023fab1621..1afc07c99d22 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -125,6 +125,11 @@ exports.lookup = function lookup(hostname, options, callback) { hints !== (exports.ADDRCONFIG | exports.V4MAPPED)) { throw new TypeError('invalid argument: hints must use valid flags'); } + + // FIXME(indutny): V4MAPPED on FreeBSD results in EAI_BADFLAGS, because + // the libc does not support it + if (process.platform === 'freebsd' && family !== 6) + hints &= ~exports.V4MAPPED; } else { family = options >>> 0; }