Page tree
Skip to end of metadata
Go to start of metadata

So my final solution was to use the freen Dynamic DNS service from http://freedns.afraid.org/  

I've set their ns1.afraid.org ... ns4.afraid.org as the name servers at my registrar (Canreg) so afraid.org has DNS authoritative control, and registered all my A and TXT records with them.  Yes, this means they could decide to add new sub-domains under politick.ca without me knowing about it and use them for their own use .... But I still retain 100% of my domain name since thay don't have access to that.  Also I've downloaded this script as a "client" to update the DDNS at bootup:  https://freedns.afraid.org/scripts/dynIPupdate.sh.txt

PolitickStartup.sh

#!/bin/sh

LogFile=/home/politick/Startup.log

echo Boot Politick $(date) >> $LogFile

# Big infinite loop
while : ; do
echo Emptying all firewall rules >> $LogFile
/etc/firewall/DeleteFirewall.sh >> $LogFile

echo Setting up firewall rules >> $LogFile
/etc/firewall/CurrentFirewall.sh >> $LogFile

echo Trying to update DDNS >> $LogFile
# Update Dynamic DNS
L=$(ip -4 addr show dev ens224 | sed -n '/inet/{s!.*inet6* !!;s!/.*!!p}' | sed 's/peer.*//')
curl https://xxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxx@freedns.afraid.org/nic/update?hostname=politick.ca&myip=$L

echo $? : Was the last exit code of the curl call >> $LogFile
echo Tried to set it to IP $L >> $LogFile


# Every hour verify if Telus has changed my dynamic IP address

while : ; do
# Sleep an hour
sleep 3600
# Check new IP address
N=$(ip -4 addr show dev ens224 | sed -n '/inet/{s!.*inet6* !!;s!/.*!!p}' | sed 's/peer.*//')
if [ "$L" == "$N" ]; then
echo IP address stayed the same $N until $(date) >> $LogFile
else
echo IP address changed from $L to $N around $(date) >> $LogFile
echo Resetting the firewall and IP address in DDNS >> $LogFile
# Exit the while loop and re-execute the DDNS update from big while loop
break
fi

done

done


If that does not work because of ACL (Telus jumps from one block of IP to another all the damn time),  Goto : Top Left menu: Preference→Manage ACL and add new IP block range

Then subdomain and manually update all records using Mass Mod for all (A) records:




I had a whole script that would run at boot time to edit my DNS zones, but Telus filters port 53 ... Why ... no reason other than to upsell you a commercial service.  Well, fuck'em.  This Script is called by the script I've registered with systemd.

AutoEditDNSZone.sh

InterIP=154.20.227.242
InterNIC=ens224

getaddr_internal() {
dev=$1
af=$2
L=$(ip $af addr show dev $dev | sed -n '/inet/{s!.*inet6* !!;s!/.*!!p}' | sed 's/peer.*//')
}
GetAddress() {
getaddr_internal $1 "-4"
}

# Find our Internet IP that was given by DHCP but Telus
GetAddress $InterNIC 4
if [ "$L" == "" ]; then
echo Internet IP address was NOT found!!!
else
InterIP=$L
fi

cat /etc/bind/politick.ca.internet.Variable | sed "s/\$IP/$InterIP/g" > /etc/bind/politick.ca.internet




  • No labels
Write a comment…