Categories
Stayno's Notes Superuser Windows

Windows dynamic dns with Freedns and task manager

Thanks to this blog post https://agurk.net/update-freedns-with-powershell-and-task-scheduler/ for detailed information.

In my experience there is a bit of a difference in the commands and code everything else is essentially the same.
Just an outline:

  • Create a log file to keep track of logs
  • Create a PowerShell script with the following code
# Change Path to desired log location and Uri to your Direct or Token URL from FreeDNS
$LogPath = "D:\\updateFreeDNS\\updateLog.log"
$web = Invoke-RestMethod -Uri "https://freedns.afraid.org/dynamic/update.php?!!!DIRECTURLORTOKENFROMFREEDNS!!!"

# No need to change this
Add-Content -Path $LogPath -Value "$(Get-Date) $web"
  • Open Task Manager and “Create a new task”
  • On Trigger tab create a schedule
  • On actions tab under Program/Scripts add
C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe
  • Still on actions tab under add arguments add
-ExecutionPolicy Bypass -File "D:\\updateFreeDNS\\updateDNS.ps1"
#Substitute the path and name of your poweshell script file

Leave a Reply

Your email address will not be published. Required fields are marked *