Skip to content

Instantly share code, notes, and snippets.

@leagris
Created March 16, 2021 18:16
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 leagris/b528664ff811faaf5bb18d959750073b to your computer and use it in GitHub Desktop.
Save leagris/b528664ff811faaf5bb18d959750073b to your computer and use it in GitHub Desktop.
OVH Ghost mutualised DNS checker
#!/usr/bin/env sh
# Domain name to retrieve ghost host RR from
__ARG_DOMAIN=${1:-example.com}
# Setup the name or IP of the ghost OVH mutu hosting DNS
__ARG_GHOST_NS=${2:-dns200.anycast.me.}
old_ip=$(
dig +short +norecurs "$__ARG_DOMAIN" "@$__ARG_GHOST_NS" -t A 2>/dev/null
)
if [ -n "$old_ip" ]; then
old_host=$(dig +short -x "$old_ip")
printf 'On %s, domain name: %s\n' "$(date -R)" "$__ARG_DOMAIN"
printf 'still has a RR in DNS: %s\n' "$__ARG_GHOST_NS"
printf 'with IP, host: %s, %s.\n' "$old_ip" "$old_host"
else
printf 'Domain name %s has no RR on DNS %s.\n' \
"$__ARG_DOMAIN" "$__ARG_GHOST_NS" >&2
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment