OPT_DYNDNS - Dynamic Hostname Service


Thomas Mueller

this package was sponsored by headwork Consulting GmbH

Description

Optional package to update a dynamic hostname entry at

For more information see the web site of the respective service provider. This list is complete, that is, other services are not supported out of the box but you can add your own, see below for details.

(* Note about dynaccess.de: This package only works for their Business tariffs and their private tariff B. The private tariff A does not allow automatic update of the ip address (as of 2001-11-11))

(** These are user contributed provider entries which I have not tested myself)

(*** At least one user has used opt_dyndns successfully with these services, I have not tested them myself.)

This package consists of a startup script that dynamically creates another script, which in turn sets the dynamic hostname to the current IP address of the router.

It is called automatically every time the router dials in and gets a new public IP address.

Note: It can take a few minutes for the update to become active.

Note: If the router does not get a new IP address on dial-in the update is performed anyway. Some service providers regard this as wasting their resources and it is possible that they disable an account because of this.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

This license covers all parts of the package with the execption of the program DynDnsConfig.exe. For this program the following exception is made: The source code is not available. (Reason: It uses some proprietary code and libraries.)

Acknowledgments

I have moved the list of people who helped me to the end of this document. It just became to long for this position.

I would like to thank all the people mentioned and also everybody else who contributed to make fli4l such a great product.

Update note

In addition to the changes caused by the update to FlI4L the names of two variables have changed from 2.1.0 to 2.1.1:

The configuration program changes this automatically so you can just load an old configuration and and save it in new format.

Otherwise please change it manually.

WARNING

The services marked with ** above have not been tested by me. I only use DynDNS.org, zoneedit.com and dynaccess.de and therefore have only tested the support for these services thoroughly. Support for the other providers are only based on the information provided by other users. If you have any problems with one of the other scripts, I am unlikely to be able to help you. But if you have any suggestions or advice on how to solve these problems, you are welcome to tell me.

Prerequisites

Installation

Required information

Make sure you have the required information of your DynDNS account and that manually setting an IP through their web site works. (If you don't know what I am talking about, go back to the dynamic DNS provider's web site and try to find out before proceeding!)

You will need:

Example for a DynDNS.org account:

Extracting the archive

Note: When extractin the archive an existing config file will be overwritten. You should make a backup copy of 'config/dyndns.txt' if you want to keep it.

Extract the ZIP archive into the FlI4L directory (e.g. 'c:\fli4l-2.0.1'). Enable extraction of subdirectories when doing that!

The following files will be extracted:

check/dyndns.txt
used to check the config
config/dyndns.txt
the config
opt/dyndns.txt
list of files to install
opt/etc/dyndns.conf
service config
opt/etc/rc.d/rc.dyndns
startup script
opt/files/usr/local/htdocs/main_dyndns.cgi
cgi script
unix/userencode.pl
base64 encoder for Linux/Unix (Perl)
windows/DynDnsConfig.exe
config program for Windows (Delphi)
doc/deutsch/opt/dyndns.txt
German documentation
doc/deutsch/opt/changes/dyndns.txt
German change history
doc/english/opt/dyndns.txt
this documentation
doc/english/opt/changes/dyndns.txt
English change history

The file '/etc/ppp/ip-up.zdyndns' is automatically created on the router at startup. It is called '*.zdyndns' rather than '*.dydns' so it will be the last script to be executed. This means that the Freenet startpage workaround (see troubleshooting section) will work and the port forwarding will be active before the ip is set.

Installation for Windows

For Windows users I have written a GUI config program in Delphi which creates the necessary configuration file automatically. The same program is also available for Linux/X-Windows, written in Kylix, but since I don't know how to ensure that it works everywhere, I have not put it into the archive. If you are interested, I can email it to you.

DynDnsConfig Program (Windows only)

  1. Start 'windows/DynDnsConfig.exe' and load the file 'config/dyndns.txt' respectively your existing config file.
  2. Use the dialog to set up provider, host/domain, username and password. The secret is generated automatically.
  3. Enable the opt package with the checkbox 'enable OPT'.
  4. Save the configuration to 'config/dyndns.txt'
  5. Go on to the creation of the floppy disk

Installation forr Unix / Linux

userencode.pl (Unix only)

Call 'userencode.pl' (Unix) with your username and password for the DynDNS provider as parameters:

 userencode.pl username password

This is a Perl script which encodes username and password in base64. The output of the script is used in the next step.

Edit configuration file

Edit the file 'config/dyndns.txt':

#-----------------------------------------
# Optional package: dyndns
#-----------------------------------------
OPT_DYNDNS='no'

# global options
DYNDNS_SCRIPT='/etc/ppp/ip-up.zdyndns' # don't change this unless you know what you are doing!
DYNDNS_SAVE_OUTPUT='yes' # make answers available for opt_httpd

DYNDNS_N='1' # update N entries

# ZONEEDIT for zoneedit.com
# DYNDNS for dyndns.org
# CJB for cjb.net
# DTDNS for dtdns.net
# DHS for dhs.org
# DYNODNS for dynodns.net
# DYNACCESS for dynaccess.de
# HAMMERNODE for hn.org
# SELFHOST for selfhost.de
# STORCKORG for storck.org

DYNDNS_PROVIDER_1='DYNACCESS'    # provider
DYNDNS_USER_1='hallo'	    # username
DYNDNS_PASSWORD_1='secret'       # password
DYNDNS_HOST_1='myhost'	   # host part of myhost.dyn-fli4l.de
DYNDNS_DOMAIN_1='dyn-fli4l.de'   # domain part of myhost.dyn-fli4l.de
DYNDNS_SECRET_1='encrypted username1 and password1 from userencode.pl'
#-----------------------------------------

Set OPT_DYNDNS to 'yes' to enable the package.

In DYNDNS_SAVE_OUTPUT you specify whether the answers from the DynDNS services should be made available via webbrowser or should just be written to the console (see below).

Now you must give the number of entries in DYNDNS_N. Normally that will be '1', unless you are using multiple subdomains or the same subdomain at multiple services or a combination of both.

For each entry you must fill a block of variables which end in the same number.

DYNDNS_PROVIDER_X is the symbolic name of the service as given in the list above. With this entry you configure how the data is transmitted to the service.

The values for DYNDNS_HOST_X and DYNDNS_DOMAIN_X depend on which subdomain you have registered. The example above assumes the subdomain 'myhost.dyn-fli4l.de' (at DynAccess.de). Some services offer only one domain and use the username for the host name. In this case you must fill in the default (eg. for dtdns: host = username and domain = darktech.org).

DYNDNS_SECRET_X is the output of the script in the previous step.

Create the boot disk

Now you can create the boot disk as usual, boot the router from it and it should work. The generated script writes the answer from the service to the console or it makes it available via web browser. If it is an error message, you probably made a configuration mistake.

Viewing the answers

When you enable DYNDNS_SAVE_OUTPUT the answers from the DynDNS services are stored temporarily in '/var/run/answer.<servicename>' and can be viewed using a web browser. This only works if you have enabled opt_httpd and configured it correctly. When you have configured it you will find an entry DynDNS in the main menu which will display the information.

Please do not ask me about installing and configuring opt_httpd, it is covered fairly well in the fli4l manual.

Adding new service providers to the package

It is rather simple to add new providers of dynamic DNS services to the package. You only need to add an entry to 'dyndns.conf' like the following:

PROVIDER_NEWPROVIDER_NAME='NewProvider.org'
PROVIDER_NEWPROVIDER_REQUEST_URL='/script.cgi?username=$DYNDNS_USER&Domain=$DYNDNS_DOMAIN&Passwd=$DYNDNS_PASSWORD&ip=\$MYIP'
PROVIDER_NEWPROVIDER_REQUEST_HOST='server.newprovider.org'
PROVIDER_NEWPROVIDER_REQUEST_PORT='Portnummer'
PROVIDER_NEWPROVIDER_REQUEST_AUTHBASIC='yes/no'

Replace the string _NEWPROVIDER_ with a unique string which describes the service provider. *_REQUEST_HOST is the server to which updates must be sent. *_REQUEST_AUTHBASIC must be 'yes' if the service uses HTML Basic Authorization. *_REQUEST_PORT is the port the server listens on for requests, usually 80 (http). The most complex part is *_REQUEST_HOST. Here you must give a url which is used to update the account. You can use the variables that are defined at the start of the section (remove the number suffix). In addition there is the variable \$MYIP. In contrast to the other variables this one must be preceded by a \ (backslash) so it is not expanded in the 'rc.dyndns' script but later in the created 'ip-up.zdyndns' script.

If you add new service providers, please send me the data, so I can add them to the package. But please only send tested entries, I don't have the time to check every single service myself.

Troubleshooting

	  8
	  bad auth
which means that authentication failed. You probably filled in the wrong string for DYNDNS_SECRET. More error codes for DynDNS.org are documented on this page: http://support.dyndns.org/dyndns/clients/devel/codes.shtml
No, there is no way to automatically set an offline IP before hanging up (unless somebody has got a great idea). Reason: The ip-down script is executed *after* the connection has gone down. If you put anything in there that accesses the internet, you would automatically reconnect, which is not what you want. There is no other way to let the router do anything before closing the connection, because the ppp deamon might not even know that the connection is going to be dropped, since this can be caused by the other end or whatever other reason.
(I don't want to read this question again.)
A solution to this problem would be to save the last IP and compare the newly assigned to it on every dialin.
Martin Kisser has suggested the following script lines:
	  if [ -f /var/run/meine.ip ]; then
	    oldip=`cat /var/run/pppoe.ip`
	  else
	    oldip="0.0.0.0"
	  fi

	  if [ "$local" != "$oldip" ]; then
	    echo $local > /var/run/meine.ip
	    STARTEDYNDNS-SCRIPT
	  fi
I have not (yet) implemented this, but if somebody does, I am happy to include his solution.

Also please notify the author of the broken OPT-package.

Feedback

If you have any questions or problems with this package: Email Thomas Mueller <opt-dyndns at s2h.cx>

Please always include the version of FlI4L and opt-DynDNS you are using. It would also help to include information about the ISP and other active opt-packages. I will from now on ignore emails that do not give this information.

Please do not ask me any questions regarding FlI4L in general, I don't do FlI4L support, unless you want to pay me. My daily rate is 800 Euro.

Acknowledgements part 2

Lots of people have helped to develop this package:



This document was generated using AFT v5.077