Featured image of post Using Azure DNS Updater: An Open Source Project

Using Azure DNS Updater: An Open Source Project

TLDR

Here’s the GitHub repo, grab it and give it a spin.

Description

This project helps you manage the headache of dynamic IP addresses. If you use Azure DNS for your DNS needs, this project will update any record-set with your current external IP address. The external IP address is fetched via a simple GET request to http://checkip.amazonaws.com/.

Requirements

You need access to an Azure Subscription and a Service Principal. The Service Principal must have the DNS Zone Contributor role to upsert recordsets.

Parameters

  • TenantId: The ID of your Azure Tenant.
  • SubscriptionId: The ID of your Azure Subscription.
  • RgName: The name of the resource group where your DNS Zone is created.
  • ZoneName: The name of your DNS Zone (e.g., something.com).
  • RecordSetName: The A record (e.g., www or any subdomain). This doesn’t need to exist before running.
  • ClientID: From your Service Principal.
  • ClientSecret: From your Service Principal.
  • IntervalInMinutes (optional): Integer representing how often (in minutes) the record will be updated (if changed). Default value is 5.

Installation (Local Copy)

Build the Docker image:

1
docker build -t dns-updater .

Run the container:

1
docker run -d -e tenantId=XXXXX -e subscriptionId=XXXXX -e rgName=XXXXX -e zoneName=XXXXX -e recordsetName=XXXXX -e clientId=XXXXX -e clientSecret=XXXXX -e intervalInMinutes=5 dns-updater

Installation (Remote Image)

Run the container using the pre-built image:

1
docker run -d -e tenantId=XXXXX -e subscriptionId=XXXXX -e rgName=XXXXX -e zoneName=XXXXX -e recordsetName=XXXXX -e clientId=XXXXX -e clientSecret=XXXXX -e intervalInMinutes=5 ghcr.io/nikosdelis/azure-dns-updater:latest
All rights reserved
Built with Hugo
Theme Stack designed by Jimmy