Last active
April 5, 2019 05:54
-
-
Save HirbodBehnam/cef5e9eae8a1db85cd1c117eb750e128 to your computer and use it in GitHub Desktop.
This script cycles IP addresses of a domain name registered with now-dns.com (Ubuntu and Centos)
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
#!/bin/bash | |
USERNAME="Now dns username" | |
PASSWORD="Now dns password" | |
HOSTNAME="testsite.now-dns.net" #Your domain | |
IP=() | |
#Create a file named ip.txt and add all of your IP addresses in it separated by new line | |
input="ip.txt" | |
while IFS= read -r var | |
do | |
IP+=("$var") | |
done < "$input" | |
while true; do | |
for i in "${IP[@]}" | |
do | |
echo "Changing IP to $i" | |
curl -u "$USERNAME":"$PASSWORD" "https://now-dns.com/update?hostname=$HOSTNAME&myip=$i" | |
#Change delay between changing IPs if you want | |
sleep 3600 | |
done | |
IP=() | |
while IFS= read -r var | |
do | |
IP+=("$var") | |
done < "$input" | |
done | |
#Run script as service or with tmux or screen; CTRL-C to terminate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
New version supports changing IP's while the script is running. Just change IP addresses in
ip.txt