Created
March 16, 2021 18:16
-
-
Save leagris/b528664ff811faaf5bb18d959750073b to your computer and use it in GitHub Desktop.
OVH Ghost mutualised DNS checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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