Giter Club home page Giter Club logo

dyndns's Introduction

Azure DNS Updater

Problem: Domains are handled by Azure DNS. One (or multiple) subdomains are pointing to a dynamic (public) IP and need to be updated on IP change.

Solution: An Azure Function that can be triggered by any authorized ddclient, basically DynDNS on Azure. ddclient is not required, as long as the dynDNS API-specs are followed.

Use-Case: Ubiquiti USG / Ubiquiti UDM dynamic DNS feature.

image

Setup

  1. Set up you DNS Zones in Azure
  2. Set up your Azure Function App (v4/.NET6, consumption plan, Application Insights enabled)

image

  1. Deploy this Azure Function to your Function App resource and configure Application Settings accordingly

Configuration

Configure a Managed Identity

Managed identity is turned on for the azure function provided in this code. This means that the azure function will function as it's own identity with it's own accesses to azure resources.

To check that you have Managed Identity turned on visit the azure function and look for Identity in the blade to the left on the azure portal.

Now we just need to assign the managed access to the azure DNS zone we want to configure.

detailed walk-through: (https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal?tabs=current)

quick guide
  1. Select "Access control (IAM)" in your DNS resource (or resource group if you have multiple DNS Zones that you want to modify)
  2. Click on "Add role assignment"
  3. Search for "DNS Zone Contributor", select it and click "Next"
  4. Click "Select Members" and search for your Managed Identtity. The name of the managed identity is identical to the name of the azure function
  5. Click "Next" and then "Review + assign"

You can double check the success of your operation by providing your Azure Function name to the "Check access" form

image

getting the remaining configuration items

  • tenantId - you can get this from your AAD Overview page
  • subscriptionId - the GUID of your subscription, can be found in the overview page of any resource
  • rgName - the name of the resource group that holds your DNS Zone resources

local testing

Set up local.settings.yaml with the following keys

{
    "Values": {
        "clientPassword": "password"
        "clientUsername": "username",
        "fqdn": "<fqdn>",
        "resourceGroupName": "<rg>",
    }
}

production

Add the following keys to your AppSettings.

Name Value
clientPassword password for dyndns client
clientUsername username for dyndns client
fqdn Your domain name. must contain a subdomain
resourceGroupName Name of the resource group with the dynamic DNS

dyndns's People

Contributors

ahysing avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.