Necessity the mother of invention……

When I got the email from DYNDNS that they will no longer be offering free service, I started looking for and alternate service to use. I notice all have catches or fees involved, so I decided to create my own dynamic DNS service using PowerShell. Yes I know it can be converted to an application (.exe) to remove PowerShell dependencies but I do not have C programming under my belt yet.

All that is needed to completely setup a Dynamic DNS are Webhosting (optional), DNS Server (with FTP) and Client Computer.

Webhosting

This step is not really required unless you want to control getting your IP yourself. In the past year few have popped up and disappear so I created mine (http://www.hazelnest.com/IPproject/MyIP/ip.php). It’s open now for everyone to use but depending on traffic it might be restricted so it’s always a good idea to create yours.

It simple on your website, create a PHP page and paste code below into page and save it.

<?php
$ip = getenv(REMOTE_ADDR);
print $ip;
?>

You can then browser to page to confirm you are getting your external IP.

 

DNS Server Setup

Your must have an external DNS Server setup, a DNS Server that is accessible from the web with a valid domain name. You can use Amazon EC2 Free Tier (http://aws.amazon.com/ec2/) to setup and external DNS Server with FTP service installed on IIS role.

Server must also be running PowerShell 4.0 for script to work correctly as it makes use of DNSServer cmdlet with is only available on PowerShell 4.0. Prerequisite for PowerShell 4.0 below;

http://technet.microsoft.com/en-us/library/hh847769.aspx

 20140413 - Powershell

 

Creating FTP Site on DNS Server

http://www.iis.net/learn/publish/using-the-ftp-service/creating-a-new-ftp-site-in-iis-7

This FTP site should point to the folder where you want the client to send IP Address file to this should be C:\IPUpdate.

Download the IPUpdate.rar file and extract the UpdateServer.ps1 file into C:\IPUpdate. In short, the end goal is for the IP Address file from client and UpdateServer.ps1 in the same folder and for the script to run flawlessly.

http://www.hazelnest.com/IPproject/MyIP/IPUpdate.rar

Create a task schedule to run the UpdateServer.ps1 at whatever interval you want the script to update/validate the IP on DNS Server is up-to-date.

Client Computer setup

Copy two files (settings.xml and GetClientIP.ps1) from the previously downloaded IPUpdate.rar and copy them to C:\IPUpdate on client machine.

Update the settings file to match your system’s configuration.

Then, Create a task schedule to run the GetClientIP.ps1 at whatever interval you want the script to get external IP and send information to DNS Server.

Video of process Below