bash script to operate as DynDNS with Azure-DNS-zone
works on debian and ubuntu
tested on raspberry Pi - Raspbian (original goal of that project)
download dyndns.sh
and make it executable
chmod +x ./dyndns.sh
Cron it (e.g twice a day or every hour)
sudo crontab -e
This script require python3
, azure-cli
, curl
, and jq
- python
sudo apt install python3
- azure-cli
following method is used with Raspbian because of no package available in sources repository however on Ubuntu or Debian use
sudo apt install azure-cli
curl https://azurecliprod.blob.core.windows.net/install.py >> installAzureCliPython.py
sudo chmod +x installAzureCliPython.py
python3 installAzureCliPython.py
exec -l $SHELL
az --version
- curl (if not installed)
sudo apt install curl
- jq (json processor) jq website
sudo apt install jq
- Azure tenant with existing azureDNSzone
- External echo/mirror ip service
In order to get current ip address you need a echo/miror ip service
you can use third party service as the excellent ifconfig.co
or use you own based on works already present on GitHub.
Use Greenstatic/echo-ip deved inGo
that fits very well with a microk8s deploy. \
Greenstatic/echo-ip is a good tool for docker/k8s env because it's able to recover X-Forwarded source ip through proxy/ingress.