Skip to content

Instantly share code, notes, and snippets.

@tuzz
Created August 3, 2012 21:18
Show Gist options
  • Select an option

  • Save tuzz/3251645 to your computer and use it in GitHub Desktop.

Select an option

Save tuzz/3251645 to your computer and use it in GitHub Desktop.
Lookup hostnames of machines on your local subnet
1.upto(254).map.with_object({}) { |i, o| n = `dig -x 192.168.1.#{i} +short`; o[i] = n unless n.empty? }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment