Skip to content

Instantly share code, notes, and snippets.

@FarFetchd
FarFetchd / gist:7863e36685d0a5695a0d79196cbf982b
Created February 27, 2019 00:25
Super simple bash dynamic DNS
# Client side (sender of their own IP), sending to port 1234
MYPUBIP=`curl https://canihazip.com/s` 2>/dev/null
echo "supersecretpassword$MYPUBIP" | nc domain.name.or.ip.of.receiver.com 1234
# Server side (receiver/displayer of the IP), listening on port 1234
while true ; do
nc -l 1234 | grep supersecretpassword | sed "s/supersecretpassword/At `date` the IP was: /"
done >>wherever_you_want_to_save_the_ip_history.txt