Skip to content

Commit

Permalink
fix: determine dns lookup result with status code (#82)
Browse files Browse the repository at this point in the history
fixes #81
  • Loading branch information
cyjake authored Apr 24, 2024
1 parent 2a134ab commit dbeaa19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ssh-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ export default class SSHConfig extends Array<Line> {
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()
Expand Down

0 comments on commit dbeaa19

Please sign in to comment.