ncjsbq
Last Updated: February 25, 2016
·
465
· bunnymatic
11d948cbd083298dea9f4f32c71f6427

get ip address of SMB network machine

Given Mac's on a local network, you can look up the IP by machine name using

smbutil lookup machine_name

The output is very verbose. If you want to use it to help ssh between machines, it ends up being a bunch of cut and paste. Add the following to your bash profile

smbip() {
  smbutil lookup $1 | head -1 | ruby -nle 'puts $_.split.last;'
}

Then you can

ssh `smbip machine_name`
Say Thanks
Respond
Filed Under