pydnsup - DNS dynamic updates from router info

The most current version is 1.0, released 2009-10-29.

Motivation

The motivation to write that little piece of software was to

  • run my own private dynamic DNS service with my own domain in a secure (TSIG backed) way
  • get the external IP address from my DSL-router per UPnP and not be dependant on some external services

So, pydnsup implements the client side. It uses a TSIG key for DNS updates and for UPnP the specification from the PDF WANIPConnection :1 Service Template Version 1.01 kindly provided by the UPnP Forumâ„ , to query the ConnectionStatus and - if connected - request the ExternalIpAdress from your local DSL/broadband router.

Requirements

  • standard python installation
  • module dnspython

History

1.0 - 2009-10-29
initial release

License

The software is licensed under a BSD style license. See license.txt.

Download

Contact

Markus Stumpf <srv-src-pydnsup@maexotic.de>

Commandline Options

-c configfile
specify an alternate config file
-d
debug; prints some info for trouble shooting
--delete
do not add/modify but delete all record for the host. This is useful before you shutdown your host or turn off the DSL router. This way no stale information is kept.
-h | --help
a brief overview of all commandline options
-i IPadress
specify an IP address to use for DNS update; skips requesting the IP address from the router
-n
no DNS update; just request the IP from the router
-v
verbose; basically just outputs the IP address. If you want more output try -d for debug.

Configuration Settings

All of the below fields are mandatory in the config file.

[dns]
keyname
this is the name that was used, when creating the key.
keyvalue
the base64 encoded string for the Key: line, that can be found in the .private file that was created when the key was created.
domain
this is the name of the (sub-)domain for which the update should happen.
host
this is the name of the host within domain for which the update should happen.
ttl
Time To Live. How long the record should be cached by DNS caches. A value of 60-300 (seconds) is reasonable
addTXT
True or False. If true a TXT record will be added along with the A record containing a timestamp, when the record was added/updated.
dslhost.dyn.example.com descriptive text "2009-10-29" "16:03:01"
dslhost.dyn.example.com has address 10.0.0.1
timeout
time in seconds to wait for the DNS update to signal a status. After that the update is treated as failed and a error message is issued.
[router]
ip
the ip address of the DSL/broadband router.
port
the port to use for the UPnP request on the router (see also table below)
http_req
the local URI to use for the UPnP request on the router (see also table below)

To query an UPnP compatible router one has to know how to access the information. Port numbers and Request-URIs differ from vendor to vendor and while they can be detected with UPnP walkers I have started a list for ease of configuration.

ManufacturerProductPortHTTP Request
AVMFRITZ!Box Fon WLAN 717049000/upnp/control/WANCommonIFC1
D-LinkDIR-30049152/upnpdev.cgi?service=WANIPConn1

Valid HTML 4.01 Transitional Valid CSS! BY- CC-3.0 Copyright © 2009 Markus 'Maex' Stumpf
created: 2009-10-25 17:52:29 GMT+1
last modified: 2009-10-29 17:03:58 GMT+1