Skip to content

Instantly share code, notes, and snippets.

@wonderbeyond
Created February 28, 2015 07:39
Show Gist options
  • Select an option

  • Save wonderbeyond/a8dc6973089290f56f5b to your computer and use it in GitHub Desktop.

Select an option

Save wonderbeyond/a8dc6973089290f56f5b to your computer and use it in GitHub Desktop.
Get only-ip address via nslookup
nslookup www.example.com | awk '{if($1=="Name:") {ptr_set=1}; if(ptr_set==1 && $1=="Address:"){print $2; exit}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment