Created
October 2, 2025 15:03
-
-
Save ThinGuy/260839e03e38daf1c24497f03b0457d4 to your computer and use it in GitHub Desktop.
Get ipinfo of an FQDN
This file contains hidden or 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
| # prereqs: dnsutils jq | |
| # sudo apt install jq dnsutils -y | |
| geoip() { | |
| dig +short ${@}| \ | |
| xargs -rn1 -P1 bash -c \ | |
| 'curl -sSlL ipinfo.io/${0}|jq -r '"'"'"\(.hostname)\n\(.ip)\n\(.city)\n\(.region)\n\(.country)"'"'"'|paste -sd,'|\ | |
| sort -t, -k5V | |
| };export -f geoip |
Author
ThinGuy
commented
Oct 2, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment