This windows service will periodically update DNS name records in AWS Route 53 with the public IP address of the current machine.
This service is useful if your ISP periodically changes your IP address and you want to keep a DNS record up-to-date.
You'll need an AWS API key which allows the service to make updates to Route 53. It's important that this key has limited access to your account.
- Locate the Hosted Zone ID for the domain you want to update.
- Create a new Policy in IAM
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "route53:ChangeResourceRecordSets",
"Resource": "arn:aws:route53:::hostedzone/<YOUR HOSTED ZONE ID>"
}
]
}- Create a new user in IAM with the above policy as its permission set
- Generate an API key for the new user
- Build the binaries (
dotnet publish -r win-x64 -c Release) - Edit the
appsettings.jsonfile with your configuration settings - Open a Powershell prompt with elevated privileges
- Initialize the event log
New-EventLog -LogName Application -Source "Route 53 Dynamic IP" - Make a new directory for the service (e.g.
mkdir "$env:ProgramFiles\Route 53 Dynamic IP") - Copy the binaries to the installation folder
- Install the service using the command
sc.exe create "Route 53 Dynamic IP" binpath="$env:ProgramFiles\Route 53 Dynamic IP\Route53DynamicIpService.exe" start=auto - Start the service
sc.exe start "Route 53 Dynamic IP"
- Add an
appsettings.secrets.jsonto your solution. This file will not be checked into GIT