Avatar of Apexadmin
 asked on

Script or program to update dynamic public IP on zone A record

Does anyone know of a script or a program (preferably free/open source) that will check your WAN IP and update an A record in a zone on a Windows DNS server?

An example of this is a small office or home office that has a dynamic IP but hosts a service on a server. The server has a zone for it's records and is primary. The name server is hosted elsewhere but the zone is secondary retrieving the records from the SO/HO server. On the SO/HO server, has anyone heard of a way to check your WAN IP and update an A record in a zone?

The obviously way to solve this problem is static IP addresses, but some ISPs make you upgrade your service to ridiculous numbers before giving you a static IP.

Just wanted to see if this was possible.
Windows Server 2008DNS

Avatar of undefined
Last Comment
George Khairallah

8/22/2022 - Mon
George Khairallah

Can you use something like DynDNS for your outside WAN address, and on the inside, just create a static entry that would have the same name as your external name, but pointed to your LAN Address. I have that setup in my home office, and it seems to work ok.

as an example, say your external WAN is  pointed to example.com  (this would be handled by DynDNS on a supported client... on your main gateway router for example)
you can create a internal A record pointed to your SO/HO  internal server IP (i.e: say   and point it to example.com  

I apologize if I answered a different question than you intended to ask. I was just a bit confused with your second paragraph. So if that's not what you want to do, please let me know, and we can think of something else.

It is more like having a separate zone for public. So you would have example.com and example.local. What would happen is you would have a script or program get your WAN IP and update an A record in example.com. That zone would be then replicated to a secondary zone offsite. So you can manage the zone internally.

I have also considered making A records with a DynDNS hostname. I just didn't know if my convoluted way was possible.
George Khairallah

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.