while () { $_= "host " . join '.', map {s/(\d+)/$1/} split /./ . "$ARGV[0] 2>&1"; `$_` =~ /$ARGV[1]/m && exit 0 } exit 1