cloudflare_ddns.ps1
Script is designed for users sharing their services 'to the internet' using Cloudflare and having dynamic IP addresses. It serves as an alternative to using DDNS. When executed, the script verifies the current public IP based on a defined list of websites. In case of an error, it moves on to the next website, searching for a correct response with the public IP. If it fails to obtain an IP, it terminates with an error. If it finds the same IP as the last time, it terminates. The script consistently uses the next service returning information about the public IP.
On Linux with PowerShell, the script should be invoked via CRON. On Windows, the script should be scheduled using Task Scheduler. If the script proceeds to verify entries from a specific DNS ZONE in Cloudflare, then: It will verify whether the obtained external IP is the same or different from the defined IP in Cloudflare.
If it is the same, the script will terminate with recording information in the log file. If it is different, it will update all entries, setting the A address to the current external IP.
NOTE
The script assumes that all entries point to one host - one IP.