---
title: "Comment by Eduard van Valkenburg on \"Dynamic DNS with Edgerouter and Azure\" | Hashnode"
description: "Great stuff! My setup is slightly different but I managed to get it to work! I&#39;m using a Unifi Security Gateway (USG) and I wanted to set the IP for my root"
url: "https://hashnode.com/posts/dynamic-dns-with-edgerouter-and-azure/6183fb5dfd5d634d01697281/comment/61855554936da605cb9aa982"
---

[Discussion](https://hashnode.com/posts/dynamic-dns-with-edgerouter-and-azure/6183fb5dfd5d634d01697281)

Comment [Dynamic DNS with Edgerouter and Azure](https://hashnode.com/posts/dynamic-dns-with-edgerouter-and-azure/6183fb5dfd5d634d01697281)

[Eduard van Valkenburg](https://hashnode.com/@eavanvalkenburg)

[Nov 5, 2021](https://hashnode.com/posts/dynamic-dns-with-edgerouter-and-azure/6183fb5dfd5d634d01697281/comment/61855554936da605cb9aa982)

Great stuff!

My setup is slightly different but I managed to get it to work!

I'm using a Unifi Security Gateway (USG) and I wanted to set the IP for my root domain, which in DNS speak is @. So to get it to work I changed the strZone regex to: "^(\[a-zA-Z@\]{1,})(.)(\[a-zA-Z.\]{1,})".

Then in the Unifi Controller interface I create a dynamic DNS record with _@.domain.com_ as hostname (and the rest the same as Niels above). This fixes the updates between unifi and DNS!

The other things I needed to do to get my system working is setup letsencrypt with the azure-dns plugin, the plugin can be found [here](https://github.com/binkhq/certbot-dns-azure). Just follow the instructions there, but I did need to create a seperate service principal in my azure AD, so make sure you are able to do that!

Finally two minor tips:

1.  I use a lot of subdomains and in my old solution for this I just had a list of those that I had some code loop through, so those were all A records with the IP address, in the DNS Zone in Azure you can do it smarter (and with that you only need 1 dynamic DNS record in Unifi) and that is to set the subdomain as A records with the _Alias record set_ set to _yes_ and pointing to the record that gets updates (@ for me). This aliasing is smarter then regular CNAMEs in DNS because it does return the IP address that it points to rather than having to do 2 lookups!
2.  you can SSH into your USG and then run these two commands once you have the dynamic DNS setup in the portal, to force the call to your function: `update dns dynamic interface <interface, in my case eth0>` and then to check the outcome: `show dns dynamic status`. If you are unsure of the interface run the second one first and then you will see the interface!

[Niels Buit](https://hashnode.com/@nielsb)

[Nov 5, 2021](https://hashnode.com/posts/dynamic-dns-with-edgerouter-and-azure/6183fb5dfd5d634d01697281/comment/61855554936da605cb9aa982#reply-618573ea936da605cb9aac6a)

That’s awesome, thanks for sharing! 👍
