Commit 3bc2e713 authored by asksven's avatar asksven

Added post

parent 040a694b
Pipeline #160946589 passed with stages
in 3 minutes and 18 seconds
title = "Manage your home-network with an Azure DNS Zone"
tags = ["docker", "rpi", "arm"]
categories = ["docker", "rpi"]
draft = false
date = "2020-06-28"
## Introduction
Azure DNS Zones is an inexpensive way to manage DNS records for your domains, even if you have dynamic IP.
Back in the days, and before greedy Oracle took it over, []( used the (free) place to be if you had a dynamic IP and wanted to expose your home-network.
Things have changed but fortunately offers like [Azure DNS Zones]( are as inexpensive as a few Euro per month, and are easy to maintain with a little scripting. This article takes you through such a script, that can be run on your server, in a Docker container or even on Kubernetes.
## What the script does
It monitors your IP address and maintains a list of domains to be up-to-date: when your IP changes the script will detect it and update your DNS zone.
## Pre-requisites
1. Install the [Azure CLI](
1. Create an Azure DNS Zone
1. Create a service principal: `az ad sp create-for-rbac --name AcmeDnsUpdater`
## Setup
[This]( repo contains the detailed instructions:
1. clone the repo
1. copy `setenv.template` to `setenv` and customize it
1. Schedule `` to run in a scheduled manner
## Advanced use
If you don't want to install the software you can run the script as a Docker container, or as a Kubernetes cron-job instead.
### Docker
docker run -e STATELESS=1 -e TWELVE_FACTORS=1 -v $PWD:/config asksven/azdnszone:5 /bin/bash -c "/ config/setenv"
### Kubernetes cron-job
Runs on amd64 and on arm processors!
1. Configure `setenv`
1. Create a namespace: `kubectl create ns azdnszone`
1. Create a configmap: `source setenv && kubectl -n azdnszone create configmap azdnszone-config --from-literal INITIALIZED=1 --from-literal appId=$appId --from-literal password=$password --from-literal tenant=$tenant --from-literal SUBSCRIPTION=$SUBSCRIPTION --from-literal REQUESTED_NAMES=$REQUESTED_NAMES --from-literal AZ_DNS_RG=$AZ_DNS_RG --from-literal PARENT_DOMAIN=$PARENT_DOMAIN --from-literal STATELESS=$STATELESS --from-literal TWELVE_FACTORS=$TWELVE_FACTORS`
1. Create a cron-job: `kubectl -n azdnszone apply -f kubernetes/`
### Challenges
The biggest challenge was multi-arch: Microsoft does not maintain non-amd64 images for the Azure CLI so I had to [build one](
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment