Skip to content

Instantly share code, notes, and snippets.

@ottosch
Last active October 1, 2023 16:44
Show Gist options
  • Save ottosch/4f3f188e04b6d7fcdfbe1be106e56376 to your computer and use it in GitHub Desktop.
Save ottosch/4f3f188e04b6d7fcdfbe1be106e56376 to your computer and use it in GitHub Desktop.
DNS lookup of Bitcoin peers
#! /bin/bash
hosts="bitcoin.jonasschnelli.ch \
seed.btc.petertodd.org \
bluematt.me \
bitcoin.schildbach.de"
if [[ "$1" == "testnet" ]]; then
hosts="testnet-seed.bitcoin.jonasschnelli.ch \
seed.tbtc.petertodd.org \
testnet-seed.bluematt.me \
testnet-seed.bitcoin.schildbach.de"
fi
echo "Looking up $hosts"
echo "========================================================================"
for i in $hosts; do
nslookup $i 2>&1 | grep Address | cut -d' ' -f2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment