diff --git a/lib/dns.js b/lib/dns.js index 55351bb77480c7..9a81dfffd6d803 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -293,7 +293,7 @@ exports.setServers = function(servers) { if (ipVersion !== 0) return newSet.push([ipVersion, serv]); - const match = serv.match(/\[(.*)\](:\d+)?/); + const match = serv.match(/\[(.*)\](?::\d+)?/); // we have an IPv6 in brackets if (match) { ipVersion = isIP(match[1]);