VOOZH about

URL: https://manpages.org/dyndns

⇱ man dyndns (1): Update IP address to dynamic DNS (DDNS) provider


dyndns(1) Update IP address to dynamic DNS (DDNS) provider

SYNOPSIS


dyndns --login LOGIN --password PASSWORD \
--host yourhost.dyndns.org

DESCRIPTION

A cross platform Perl client for updating dynamic information at supported providers (see ). By Default this program expects www.dyndns.org provider.

The dynamic services allow mapping a dynamic address to a static hostname. This way the host can be refered by name instead of the changing address from the 's pool. Some providers offer a single account and a single host namefree of charge. Please check the information from the Providers' pages.

Separate files are used for remembering the last address to prevent updating the same address again. This is necessary in order to comply guidelines of the providers where multiple updates of the same address could cause your domain to be blocked. You should not normally need to touch the files where the addresses are stored.

If you know what you are doing and desperately need a forced update, delete the files and start program with apropriate arguments. Without the information about previous address, program sends a new update request to the provider.

Program has been designed to work under any version of Windows or Linux, possibly Mac included. It may not work under other Unix/BSD variants. Please see section how to provide details to add support for other operating systems.

Visit the page of the provider and create an account. Write down the login name, password and host name you registered.

For Windows operating systems, you need to install Perl. There are two Perl incarnatons: Native Windows version (Activestate Perl) and Cygwin version. The is recommended as it more closely follows the original Perl environment.

OPTIONS

Gneneral options

--config=FILE [--config=FILE ...]
List of configuration files to read. No command line options other than --verbose, --debug or --test should be appended or results are undefined. Each file must contain complete account configuration.

The part will go through Perl's function, meaning that the filenames are expanded. Series of configuration files can be run at once e.g. within directory by using a single option. The order of the files processed is alphabetical:

 --config=/etc/dyndns/*

See section for more information how to write the files.

--host=host1 [--host=host2 ...]
Use registered (s).
--group
This option is only for --provider noip

Assign to Do you have many hosts that all update to the same address? Update a group instead of a many hosts.

--login
account's name.
--mxhost MX-HOST-NAME
This option is only for --provider dyndns

Update account information with hostname. Specifies a Mail eXchanger for use with the host being modified. Must resolve to an static address, or it will be ignored. If you don't know don't touch this option.

The servers you list need to be correctly configured to accept mail for your hostname, or this will do no good. Setting up a server as an without permission of the administrator may get them angry at you. If someone is contacted about such an infraction, your record will be removed and possibly further action taken to prevent it from happening again. Any mail sent to a misconfigured server listed as an may bounce, and may be lost.

--mx-option
This option is only for --provider dyndns

Turn on option. Request that the in the previous parameter be set up as a backup. This means that mail will first attempt to deliver to your host directly, and will be delivered to the listed as a backup.

Note regarding provider :

Update clients cannot change this value. Clients can only submit requests to the php script to update the A record. Changes such as records must be done through website.

--offline
If given, set the host to offline mode.

[dyndns] This feature is only available to donators. The ``!donator'' return message will appear if this is set on a non-donator host.

This is useful if you will be going offline for an extended period of time. If someone else gets your old your users will not go to your old address.

--password
account's
--system {dyndns|statdns|custom}
This option is only for --provider dyndns

The system you wish to use for this update. will update a dynamic host, will update a MyDynDNS Custom host and will update a static host. The default value is and you cannot use other options (statdns|custom) unless you donate and gain access to the more advanced features.

See the provider's pages for more information.

--wildcard
Turn on wildcard option. The wildcard aliases to the same address as

Additional options

-D, --daemon []
Enter daemon mode. The term ``daemon'' refers to a standalone processes which keep serving until killed. In daemon mode program enters into infinite loop where address changes are checked periodically. For each new ip address check, program waits for WAIT-MINUTES. Messages in this mode are reported using syslog(3); if available.

This option is designed to be used in systems that do not provide Unix-like cron capabilities (e.g under Windows ). It is better to use cron(8) and define an entry using crontab(5) notation to run the update in periodic intervals. This will use less memory when Perl is not permanently kept in memory like it would with option --daemon.

The update to provider happens only if

 1) IP address changes
 2) or it has taken 30 days since last update.
 (See DDNS providers' account expiration time documentation)

The minimum sleep time is 5 minutes. Program will not allow faster wake up times(*). The value can be expressed in formats:

 15 Plain number, minutes
 15m (m)inutes. Same sa above
 1h (h)ours
 1d (d)days

This options is primarily for permanent Internet connection. If you have a dial-up connection, it is better to arrange the update at the same time as when the connection is started. In Linux this would happen during .

(*) Perl language is intensive so any faster check would put considerable strain on system resources. Normally a value of 30 or 60 minutes will work fine in most cases. Monitor the 's rotation time to adjust the time in to use sufficiently long wake up times.

--ethernet []
In Linux system, the automatic detection uses program . If you have multiple network cards, select the correct card with this option. The default device used for query is .
--file
Prefix where to save information. This can be a) a absolute path name to a file b) directory where to save or c) directory + prefix where to save. Make sure that files in this location do not get deleted. If they are deleted and you happen to update ip twice within a short period - according to www.dyndns.org your address may be blocked.

On Windows platform all filenames must use forward slashs like , not .

The is only used as a basename for supported accounts (see --provider). The saved filename is constructed like this:

 PREFIX<ethernet-card>-<update-system>-<host>-<provider>.log
 |
 See option --system

A sample filename in Linux could be something like this if were set to :

 /var/log/dyndns/eth0-statdns-my.dyndns.org-dyndns.log
-f, --file-default
Use reasonable default for saved file (see --file). Under Windows, % is used. Under Linux the PREFIXes searched are
 /var/log/dyndns/ (if directory exists)
 /var/log/ (system's standard)
 $HOME/tmp or $HOME If process is not running under root

This options is by default activated if --file is not in use.

--proxy
Use as outgoing proxy.
-P, --provider
By default, program connects to to update the dynamic address. There are many free dynamic providers are reported. Supported list of in alphabetical order:
 hnorg No domain name limists
 Basic DDNS service is free (as of 2003-10-02)
 http://hn.org/
 dyndns No domain name limits.
 Basic DDNS service is free (as of 2003-10-02)
 http://www.dyndns.org/
 See also http://members.dyndns.org/
 noip No domain name limits.
 Basic DDNS service is free (as of 2003-10-02)
 http://www.no-ip.com/

as of 2010, the support for sites of hnorg, noip is probably non-working due to changes in the interfaces. Please use only dyndns at this time.

--query
Query current address and quit. Note: if you use router, you may need --urlping* options, otherwise the address returned is your subnet's and not the 's Internet

Output of the command is at least two string. The second string is if the saved ip file name is not specified. In order to program to know where to look for saved files you need to give some --file* or --config option. The second string can also be if current address is same as what was found from saved file. Examples:

 100.197.1.6 last-ip-info-not-available
 100.197.1.6 100.197.1.7
 100.197.1.6 nochange 18
 |
 How many days since last saved IP

Note for tool developers: additional information may be provided in future. Don't rely on the count of the output words, but instead parse output from left to right.

--query-ipchanged ['exitcode']
Print message if has changed or not. This option can take an optional string argument which causes program to indicate changed ip address with standard shell status code (in bash shell that would available at variable ):
 $ dyndns --query-ipchange exitcode --file-default \
 --provider dyndns --host xxx.dyndns.org
 $ echo $?
 ... the status code of shell ($?) would be:
 0 true value, changed
 1 false value, error code, i.e. not changed

Without the argument, the returned strings are:

 Current IP address
 |
 changed 35 111.222.333.444
 nochange 18
 |
 Days since last IP update. Based on saved IP file's
 time stamp.

If the last saved file's time stamp is too old, then even if the were not really changed, the situation is reported with word . This is due to time limits the providers have. The account would expire unless it is updated in days.

Note for tool developers: additional information may be provided in future. Don't rely on the count of the output words, but instead parse output from left to right.

--query-ipfile
Print the name of the file and quit.

Note: In order for this option to work, you must supply all other options would be normally pass to update the account, because the Ip filename depends on these options. Alternatively provide option --config from where all relevant information if read.

 --ethernet [optional, defaults to eth0]
 --provider [optional, defaults to dyndns]
 --system [optional, defaults to dyndns]
 --host required.

Here is an example which supposed that directory already exists:

 $ dyndns --file-default --query-ipfile \
 --provider dyndns --host xxx.dyndns.org
 /var/log/dyndns/eth0-dyndns-dyndns-xxx-dyndns.org.log
--regexp
In host, which has multiple netword cards, the response can include multiple addresses. The default is to pick always the first choice, but that may not be what is wanted. The regexp not contain capturing parentheses: if you need one, use non-capturing choice (?:). Refer to Perl manual page for more information about non-cpaturing regular expression parentheses.

Here is an example from Windows:

 Ethernet adapter {3C317757-AEE8-4DA7-9B68-C67B4D344103}:
 Connection-specific DNS Suffix . :
 Autoconfiguration IP Address. . . : 169.254.241.150
 Subnet Mask . . . . . . . . . . . : 255.255.0.0
 Default Gateway . . . . . . . . . :
 Ethernet adapter Local Area Connection 3:
 Connection-specific DNS Suffix . : somewhere.net
 IP Address. . . . . . . . . . . . : 193.10.221.45
 Subnet Mask . . . . . . . . . . . : 255.255.0.0
 Default Gateway . . . . . . . . . : 10.10.0.101

The 193.10.221.45 is the intended dynamic address, not the first one. To instruct searching from somewhere else in the listing, supply a regular expressions that can match a portion in the listing after which the address appears. In the above case, the regexp could be:

 --regexp "Connection 3:"

In Windows, the words that follow `` Address'' are automatically expected, so you should not add them to the regexp.

In FreeBSD 4.5, you may get following response:

 tun0: flags <UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1492
 inet6 fe80::250:4ff:feef:7998%tun0 prefixlen 64 scopeid 0x7
 inet 62.214.33.49 --> 255.255.255.255 netmask 0xffffffff
 inet 62.214.32.12 --> 255.255.255.255 netmask 0xffffffff
 inet 62.214.35.49 --> 255.255.255.255 netmask 0xffffffff
 inet 62.214.33.163 --> 62.214.32.1 netmask 0xff000000
 Opened by PID 64

The correct address to pick from the listing is the one, which does not contain netmask 0xffffffff. The picked address for above is therefore 62.214.33.163. The regexp that finds that line is:

 --regexp ".*0xffffffff.*?inet"
 | |
 | Search minimum match until word "inet"
 search maximum match

This will match all the way until the the last line with netmask 0xffffffff, after which shortest match to is reached to read the number following it. The regexp must make sure that the next word after its match point is the wanted address.

Cable, and router options

If you do not have direct access to world known address, but to a subnet address, then you cannot determine your outside world address from your machine directly. See picture below:
 router/subnet Internet
 +-------------+ +-----------+
 Your PC: | | maps address | |
 connect to ISP --> | ROUTER | -------------> | |
 | 192.168.... | | 80.1.1.1 |
 local ip says: +-------------+ +-----------+
 192.168.xxx.xxx THE REAL IP

and cable modem and other connections may not be directly connected to Internet, but to a router to allow subnnetting internal hosts. This makes several computers to access the Internet while the has offered only one visible address to you. The router makes the mapping of the local subnet to the world known address, provided by the when the connection was established.

You need some way to find out what is the real is. The simplest way is to connect to a some web page, which runs a reverse lookup service which can show the connecting address.

Note: the following web web page does not exists. To find a service that is able to display your address, do a google search. Let's say, that you found a fictional service and somewhere in the web page it reads:

 Your IP address is: 212.111.11.10

This is what you need. To automate the lookup from web page, you need to instruct the program to connect to page and tell how to read the ip from page by using a regular expression. Consult Perl's manual page if you are unfamiliar with the regular expressions. For the above fictional service, the options needed would be:

 --urlping "http://showip.org/?showit.pl"
 --urlping-regexp "address is:\s+([\d.]+)"
 | ||
 | |+- Read all digits and periods
 | |
 | +- capturing parentheses
 |
 +- expect any number of whitespaces

The text to match from web page is not text/plain, but text/html, so you must look at the page's sources to match the address correctly without the bold <b> tags etc.

--urlping
Web page where world known address can be read. If you find a Web server that is running some program, which can show your addres, use it. The example below connects to site and calls program to make show the connector's address. Be polite. Making calls like this too often may cause putting blocks to your site.
 http://www.dyndns.org/cgi-bin/check_ip.cgi

Be sure to use period of 60 minutes or more with --daemon option to not increase the load in the ``ping'' site and cause admin's to shut down the service.

--urlping-dyndns
Contact http://www.dyndns.org service to obtain address information. This is shorthand to more general optiopn --urlping.
--urlping-linksys []
Specialized router option for Linksys products.

This option connects to Linksys Wireless 4-point router, whose page is by default at local network address -<http://192.168.1.1/Status.htm>. The world known address (which is provided by ) is parsed from that page. The product is typically connected to the cable or modem. Refer to routing picture presented previously.

If the default login and password has been changed, options --urlping-login and --urlping-password must be supplied

For information, See <http://www.linksys.com/>. Products codes currently supported include:

 - BEFW11S4, Wireless Access Point Router with 4-Port Switch.
 Page: http://192.168.1.1/Status.htm
 - WRT54GL, Wireless WRT54GL Wireless-G Broadband Router.
 Page: http://192.168.1.1/Status_Router.asp

--urlping-login
If web page requires authentication, supply user name for a secured web page.
--urlping-password
If web page requires authentication, supply password for a secured web page.
--urlping-regexp
After connecting to page with --urlping , the web page is examined for The regexp must catch the to perl match . Use non-capturing parenthesis to control the match as needed. For example this is incorrect:
 --urlping-regexp "(Address|addr:)\s+([0-9.]+)"
 | |
 $1 $2

The match be in ``$1'', so you must use non-capturing perl paentheses for the first one:

 --urlping-regexp "(?:Address|addr:) +([0-9.]+)"
 | |
 non-capturing $1

If this option is not given, the default value is to find first word that matches:

 ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)

Miscellaneous options

--debug []
Turn on debug with optional positive Use this if you want to know details how the program initiates connection or if you experience trouble contacting provider.
--help
Print help
--help-html
Print help in format.
--help-man
Print help page in Unix manual page format. You want to feed this output to nroff -man in order to read it.
--test []
Run in test mode, do not actually update anything. allows sending ping options and getting answers.
--test-driver
This is for developer only. Run internal integrity tests.
--test-account
This is for developer only. Uses test account options. All command line values that set host information or provider are ignored. Refer to client page at http://clients.dyndns.org/devel
--verbose
Print informational messages.
--version
Print version and contact information.

EXAMPLES

To update address periodically, use crontab(5) entry. The update will happen only if has changed since last time:
 0 0-23 * * * perl <absolute path>/dyndns <options>

To check current address:

 dyndns --query [--urlping...]
 |
 Select correct option to do the "ping" for IP

Show where the ip file is/would be stored with given connect options. The option --file-default uses 's default directory structure.

 dyndns --file-default --query-ipfile --provider dyndns \
 --host xxx.dyndns.org

To upate account information to provider:

 dyndns --provider dyndns --login <login> --password <pass> --host your.dyndns.org

If your router can display a web page containing the world known address, you can instruct to ``ping'' it. Suppose that router is at address 192.168.1.1 and page that displays the world known is , and you have to log in to the router using username and password :

 dyndns --urlping http://192.168.1.1/Status.html \
 --urlping-login foo \
 --urlping-pass bar \

If the default regexp does not find address from the page, supply your own match with option --urlping-regexp. In case of doubt, add option --debug 1 and examine the responses. In serious doubt, contact the maintainer (see option --version) and send the full debug output.

Tip: if you run a local web server, provider can direct calls to it. See option to enable `*.your.dyndns.org' domain delegation, like if it we accessed using `www.your.dyndns.org'.

CONFIGURATION FILE

Instead of supplying options at command line, they can be stored to a configuration file. For each account and different domains, a separate configuration file must be created. The configuration files are read with option --config.

The syntax of the configuration file includes comments that start with (#). Anything after hash-sign is interpreted as comment. Values are set in = fashion, where spaces are non-significant. Keys are not case sensitive, but values are.

Below, lines marked with [default] need only be set if the default value needs to be changed. Lines marked with [noip] or [dyndns] apply to only those providers' accounts. Notice that some keys, like , can take multple values seprated by colons. On/Off options take values [1/0] respectively. All host name values below are fictional.

 # /etc/dyndns/dyndns.conf
 # Set to "yes" to make this configuration file excluded
 # from updates.
 disable = no # [default]
 ethernet = eth0 # [default]
 group = mygourp # Provider [noip] only.
 host = host1.dyndns.org, host1.dyndns.org
 # If you route mail. See dyndns.org documentation for details
 # how to set up MX records. If you know nothing about DNS/BIND
 # Don't even consider using this option. Misuse or broken
 # DNS at your end will probably terminate your 'free' dyndns contract.
 mxhost = mxhost.dyndns.org
 # Details how to get the world known IP address, in case the standard
 # Linux 'ifconfig' or Windows 'ipconfig' programs cannot be used. This
 # interests mainly Cable, DSL and router owners. NOTE: You may
 # not use all these options. E.g. [urlping-linksys4] is alternate
 # to [urlping] etc. See documentation.
 urlping-linksys = BEFW11S4
 urlping-login = joe
 urlping-password = mypass
 urlping = fictional.showip.org
 urlping-regexp = (?:Address|addr:)\s+([0-9.]+)
 # Where IPs are stored. Directory name or Directory name with
 # additional file prefix. The directory part must exist. You could
 # say 'file = /var/log/dyndns/' but that's the default.
 file = default # Use OS's default location
 # The DDNS account details
 login = mylogin
 password = mypass
 provider = dyndns # [default]
 proxy = myproxy.myisp.net # set only if needed for HTTP calls
 # Hou need this option only if you have multiple ethernet cards.
 # After which regexp the IP number appers in ifconfig(1) listing?
 regexp = .*0xffffffff.*?inet
 # What account are you using? Select 'dyndns|statdns|custom'
 system = dyndns # Provider [dyndns] only
 # Yes, delegate all *.mydomain.dyndns.org calls
 wildcard = 1
 # End of cnfiguration file

See the details of all of these options from the corresponding command line option descriptions. E.g. option 'ethernet' in configuration file corresponds to --ethernet command line option. The normal configuration file for average user would only include few lines:

 # /etc/dyndns/myhost.dyndns.org.conf
 host = myhost.dyndns.org
 file = default # Use OS's default location
 login = mylogin
 password = mypassword
 provider = dyndns
 system = dyndns # or 'statdns'
 wildcard = 1 # Delegate *.mydomain.dyndns.org
 # End of cnfiguration file

(write Debian daemon scripts)

 update-rc.d dyndns start 3 4 5 6 # Debian

SUPPORT REQUESTS

For new Operating System, provide all relevant commands, their options, examples and their output which answer to following questions. The items in parentheses are examples from Linux:
 - How is the OS detected? Send result of 'id -a', or if file/dir
 structure can be used to detect the system. In Lunux the
 existence of /boot/vmlinuz could indicate that "this is a Linux
 OS".
 - What is the command to get network information (commandlike 'ifconfig')
 - Where are the system configuration files stored (in directory /etc?)
 - Where are the log files stored (under /var/log?)

To add support for routers that can be connected through protocol or with some other commands, please provide connection details and full response:

 wget -O <route-model>-dump.html http://192.168.1.0/your-network/router/page.html

TROUBLESHOOTING

1. Turn on --debug to see exact details how the program runs and what requests are sent and received.

2. Most of the <--query> options can't be used standalone. Please see documentation what additional options you need to supply with them.

ENVIRONMENT

Directory of temporary files. Defaults to system temporary dir.

FILES

Daemon startup file
 /etc/default/dyndns

In Linux the syslog message files are:

 /etc/syslog.conf daemon.err daemon.warning
 /var/log/daemon.log

There is no default location where program would search for configuration files. Configuration files may be found in directory . It is recommended that the examples are modified and copied one directorory up in order to use option --config /etc/dyndns/*.

If program is run with Windows Activestate Perl, the log file is stored to file .

EXIT STATUS

Not defined.

DEPENDENCIES

Uses standard Perl modules.

HTTP::Headers HTTP::Request::Common LWP::UserAgent LWP::Simple Sys::Syslog

STANDARDS

The dyndns provider's client specification is at https://www.dyndns.com/developers/specs/

BUGS AND LIMITATIONS

Cygwin syslog

There is no syslog daemon in Cygwin. The Cygwin emulation layer takes care about syslog requests. On and above systems it logs to the Windows's event manager, on Win9x and a file is created in the root of drive . See message <http://cygwin.com/ml/cygwin/2002-10/msg00219.html> for more details.

You can see the entries in W2K Start => Settings => Administrative Tools => Computer Management: [ System Tools / Event Viewer / Application ]

Debugging errors

Please use option --debug 2 and save the result. Contact maintainer if you find bugs or need new features.

About providers hnorg and noip

The program is primarily developed and maintained to support dyndns.org. The other providers haven't been tested since 2003.

AUTHOR

This program is free software; you can redistribute and/or modify program under the terms of General Public license either version 2 of the License, or (at your option) any later version.

The documentation may be distributed subject to the terms and conditions set forth in General Public License v2 or later (); or, at your option, distributed under the terms of Free Documentation License version 1.2 or later ().