2

I search a gratis application that runs as a Windows service and updates the IP address of a dynamic DNS account.

It should match this:

  • is gratis
  • is able to run on Windows version from XP to 10, x86 and x64
  • only updates when the IP really changed / does not updated too often (in order to keep the account from being blocked because of flooding)
  • is actively maintained and not outdated
  • is lightweight (does not need Java, Python or similar runtimes)
  • supports custom update URLs
  • runs as a Windows service
2

First of all, the best thing you could do is set up your router to automatically update dyndns (mine has this option). This is good because you don't need your PC to be on for the IP to update and nothing has to be installed and slow down the computer.

Second: The best I can think of is No-IP

It does everything you need (not sure about the service, but it can auto start and run in the background).

The catch is that you recive an E-mail every 30 days with a link you have to press to keep your DNS running, however I have never recived this E-mail or never clicked a single link in that E-mail in about a year and the DNS still running :-)


EDIT: The only thing I can think of for your need is www.duckdns.org

It does everything on the list besides the frequent updates but more on that later. (the domains are YOURDOMANEHERE.duckdns.org which is a bit silly if you ask me)

The good part about this is that a VBS script is on their website and their IP can be updated from that script.

This means that you could create a simple script with Python or C by following their script (it's like 10 lines long) or you could use their script which would update the IP as you need it or periodically.

The only problem now is if you need to have access to local devices on the remote network you need to open a port and you need to know the local IP.

If you want me to write a Python script for you to do what you want I would be more than happy to do it (You can compile Python into an EXE).


EDIT 2: Forgot to mention that you need to register to use DuckDNS (you can do this with Google, Facebook, Reddit, Twitter, or Persona) and if you want more than 5 IPs per account you need to pay.


EDIT 3: Damn... I have too much free time...

I wrote a Python script (compatible with both Python 2 and 3) for updating 2 DynDNS services: DuckDNS and nsupdate.info (nsupdate.info has unlimited host names for free)

Here is the script:

from ssl import SSLContext, CERT_REQUIRED, PROTOCOL_TLSv1
try:
    from urllib.request import urlopen, HTTPSHandler, HTTPBasicAuthHandler, HTTPPasswordMgrWithDefaultRealm, install_opener, build_opener
except:
    from urllib2 import urlopen, HTTPSHandler, HTTPBasicAuthHandler, HTTPPasswordMgrWithDefaultRealm, install_opener, build_opener

def duckUpdate(domain, token, ip=""):
    """
    Function to update IP for the dyndns service duckdns.org

    domain - specify which host to update (Ex. 'test' or 'foobar' (don't include 'duckdns.org' in domain name))
    token  - your account's token
    ip     - custom IP if you don't want to use your current/own IP
    """

    url = "https://www.duckdns.org/update?domains=%s&token=%s&ip=%s" % (domain, token, ip)

    data = urlopen(url)
    text = data.read().decode("utf-8")

    return text

def nsUpdate(domain, token):
    """
    Function to update IP for the dyndns service nsupdate.info

    domain - specify which host to update (Ex. 'test.nerdpol.ovh' or 'test.nsupdate.info')
    token  - your host's 'secret'
    """

    url = "http://ipv4.nsupdate.info/nic/update"
    authdata = "%s:%s" % (domain, token)

    context = SSLContext(PROTOCOL_TLSv1)
    context.verify_mode = CERT_REQUIRED
    httpsHandler = HTTPSHandler(context = context)
    manager = HTTPPasswordMgrWithDefaultRealm()
    manager.add_password(None, url, domain, token)
    authHandler = HTTPBasicAuthHandler(manager)
    opener = build_opener(httpsHandler, authHandler)
    install_opener(opener)
    response = urlopen(url)

    return response.read().decode("utf-8")

This is pretty much self explanatory. You call duckUpdate() or nsUpdate() with sufficent arguments and it updates the IP on their servers.

The standalone working script:

It updates the nsupdate.info DynDNS servers with the correct IP.

from os import environ
from ssl import SSLContext, CERT_REQUIRED, PROTOCOL_TLSv1
from urllib2 import urlopen, HTTPSHandler, HTTPBasicAuthHandler, HTTPPasswordMgrWithDefaultRealm, install_opener, build_opener

def nsUpdate(domain, token):
    """
    Function to update IP for the dyndns service nsupdate.info

    domain - specify which host to update (Ex. 'test.nerdpol.ovh' or 'test.nsupdate.info')
    token  - your host's 'secret'
    """

    url = "http://ipv4.nsupdate.info/nic/update"
    authdata = "%s:%s" % (domain, token)

    context = SSLContext(PROTOCOL_TLSv1)
    context.verify_mode = CERT_REQUIRED
    httpsHandler = HTTPSHandler(context = context)
    manager = HTTPPasswordMgrWithDefaultRealm()
    manager.add_password(None, url, domain, token)
    authHandler = HTTPBasicAuthHandler(manager)
    opener = build_opener(httpsHandler, authHandler)
    install_opener(opener)
    response = urlopen(url)

    return response.read().decode("utf-8")

if __name__ == "__main__":
    userpath = environ["USERPROFILE"].replace("\\", "/")

    f = open(userpath + "/dyndnsconf", "r")
    data = f.read()
    f.close()

    prop = data.split("\n")

    nsUpdate(prop[0], prop[1])

The script above, immediately after it's opened, reads data from a file found in C:\Users\CurrentUser\dyndnsconf (dyndnsconf is a FILE without an extension).

The path C:\Users\CurrentUser\ is in Windows represendet as a (hidden) local enviroment variable - %USERPROFILE%.

So the file is, in general, located in %USERPROFILE%\dyndnsconf.

Now that you have a file in C:\Users\Jan\dyndnsconf it looks like this:

mydomain.nsupdate.info
ZBtalzgMeI

The first line is the domain name you want to update and the second line the secret

the secret = token/password/key/whatever, note that anyone can use this key to update the IP on a single domain without confirmation, but they cannot moderate the account asociated with the secret

Usage of the (second) script:

  • You need to have valid domain name and secret key in the file mentioned above
  • You need to have Python 2 or Python 3 installed

Save the second script to a file called yourNameHere.py and open it. Yes. That's it. Now the IP is updated.

You can make the script open every X minutes or put it in the Windows Scheduler, check if the IP changed... whatever you want.

If you don't know how you can look it up. The most obvious and simplest was is using either batch or VBS.

The good stuff:

Because I have soo much free time I compiled a 4 MB EXE file that does the same as the second script except you can skip:

  • Installing Python
  • Creating a .py file
  • Making sure everyone who you give the file to has Python installed

You can download it here: https://mega.nz/#!Rtth1C4S!2teBXkOcyh-G4IFTI3qxexrOH1qtCiunaCIFRG2vPHk

The big problem: VirusTotal shows 16/56 detection. Bummer.

If you don't trust me you can compile the second script as is using the following command (make sure you have pyInstaller installed as well as the latest Python 2 32-bit).

pyInstaller scriptPathHere.py --onefile --noconsole

If you need anything else you can post a comment, but I won't be home this week so you have more luck looking for the answer on the internet.

(I'm too tired to check grammar and misspellings on this thing. Mods or whoever has time please edit the mistakes. Thanks!)

  • Unfortunately many providers in Germany disable dyndns in the router, because of this I search for this software. The prolongation that might become necessary is a problem because I need this setup for people who are not into IT and they will not be able to handle this kind of email (I think they will just delete it right away) – Marged Mar 14 '16 at 5:04
  • @Marged Edited answer. – Ciprum Mar 14 '16 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.