Skip to content

Instantly share code, notes, and snippets.

@audiodude
Created June 22, 2026 13:54
Show Gist options
  • Select an option

  • Save audiodude/4e0d106cb2f0e018b1fb6d6cd0a4c021 to your computer and use it in GitHub Desktop.

Select an option

Save audiodude/4e0d106cb2f0e018b1fb6d6cd0a4c021 to your computer and use it in GitHub Desktop.
domaincheck() {
local code
code=$(curl -sL -o /dev/null -w '%{http_code}' "https://rdap.org/domain/$1")
case "$code" in
404) echo "$1: available" ;;
200) echo "$1: taken" ;;
*) echo "$1: unclear (HTTP $code)" ;;
esac
}
tmoney@tmoney-linux:~/code/vibes$ domaincheck travisbriggs.com
travisbriggs.com: taken
tmoney@tmoney-linux:~/code/vibes$ domaincheck fooboarasdf.com
fooboarasdf.com: available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment