Skip to content

Instantly share code, notes, and snippets.

@mitio
Created July 13, 2014 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitio/c578b1e49048f1c508e3 to your computer and use it in GitHub Desktop.
Save mitio/c578b1e49048f1c508e3 to your computer and use it in GitHub Desktop.
Resolves a hostname and copies the A DNS record to the clipboard. OS X only.
#!/bin/bash
HOST="$1"
echo "Looking up $HOST..."
IP=`dig $HOST +short`
echo -n $IP | pbcopy
echo "Copied $IP to the clipboard."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment