diff --git a/src/ssh-config.ts b/src/ssh-config.ts index 436f11a..403de69 100644 --- a/src/ssh-config.ts +++ b/src/ssh-config.ts @@ -226,8 +226,8 @@ export default class SSHConfig extends Array { if (canonicalDomains.length > 0 && canonicalizeHostName) { for (const domain of canonicalDomains) { const host = `${line.value}.${domain}` - const { stdout } = spawnSync('nslookup', [host]) - if (!/server can't find/.test(stdout.toString())) { + const { status } = spawnSync('nslookup', [host]) + if (status === 0) { context.params.Host = host setProperty('Host', host) doPass()