diff --git a/test/internet/test-dns-ipv6.js b/test/internet/test-dns-ipv6.js index 2929361f16ecc8..26101eecc84fb2 100644 --- a/test/internet/test-dns-ipv6.js +++ b/test/internet/test-dns-ipv6.js @@ -179,7 +179,12 @@ TEST(function test_lookup_all_ipv6(done) { TEST(function test_lookupservice_ip_ipv6(done) { var req = dns.lookupService('::1', 80, function(err, host, service) { - if (err) throw err; + if (err) { + // Not skipping the test, rather checking an alternative result, + // i.e. that ::1 may not be configured (e.g. in /etc/hosts) + assert.strictEqual(err.code, 'ENOTFOUND'); + return done(); + } assert.equal(typeof host, 'string'); assert(host);