Skip to content

Instantly share code, notes, and snippets.

@tuzz
Created August 3, 2012 21:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuzz/3251645 to your computer and use it in GitHub Desktop.
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