From b97368ba33b839c76c47b854e6bdc47e1001c083 Mon Sep 17 00:00:00 2001 From: juanescarraga <32574306+juanescarraga@users.noreply.github.com> Date: Tue, 12 Nov 2019 14:26:10 -0500 Subject: [PATCH] Code refactor for DNS suffix --- lib/network.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/network.js b/lib/network.js index 5b4dfd3..c939f30 100644 --- a/lib/network.js +++ b/lib/network.js @@ -278,11 +278,11 @@ function getWindowsDNSsuffixes() { function getWindowsIfaceDNSsuffix(ifaces, ifacename) { let dnsSuffix = ''; + // Adding (.) to ensure ifacename compatibility when duplicated iface-names + const interfaceName = ifacename + '.'; try { - console.log('aca vamos', ifaces); - console.log(ifacename); const connectionDnsSuffix = ifaces.filter((iface) => { - return ifacename.includes(iface.name); + return interfaceName.includes(iface.name + '.'); }).map((iface) => iface.dnsSuffix); if(connectionDnsSuffix[0]) { dnsSuffix = connectionDnsSuffix[0];