Install Configure Inadyn Dyndns

Table of Contents

How install and configure inadyn Installation and configuration of inadyn on VTI and VIX images for being able to use service no-ip: 1) Download enigma2-plugin-extensions-inadyn.vuplus_1.2-r0_mipsel.ipk. Contribute to troglobit/inadyn development by creating an account on GitHub. Brew install --HEAD troglobit/inadyn/inadyn. And run the Inadyn configure script.

Introduction

  • An update client is a computer application or a feature in your router that keeps your hostname’s IP address up-to-date. The update client periodically checks your network’s IP address; if it sees that your IP address has changed, it sends (updates) the new IP address to your hostname in your Dyn account.
  • The dyndns_system parameter does not represent a server name, but a service name which tells inadyn internally what provider's service needs to be updated. As you correctly did, you checked the inadyn documentation for allowed values of this parameter dyndns_system.These values are relevant for inadyn only, not for Dyn or Dyn's services.
  • Save the configuration file and change the file permission. Chmod 640 /etc/inadyn.conf. Now, we want inadyn to start every time the system rebooted. Export EDITOR=nano. In the crontab, add this at the very first line. @reboot inadyn. We can run Inadyn instantly by entering inadyn command in the terminal window.

Inadyn is a small and simple Dynamic DNS, DDNS, client with HTTPSsupport. Commonly available in many GNU/Linux distributions, used inoff the shelf routers and Internet gateways to automate the task ofkeeping your Internet name in sync with your public¹ IP address. It canalso be used in installations with redundant (backup) connections to theInternet.

How to install and configure inadyn on CentOS 6. 5 minute read. Inadyn is a command line utility for periodically checking and updating your ip address with DynDNS. The guide will walk you through installing and configuring inadyn as a service on Centos 6. All commands in this guide will either need to be run as the root user or with sudo.

Most people are unaware they share a pool of Internet addresses withother users of the same Internet Service Provider (ISP). Protocols likeDHCP, PPPoE, or PPPoA are used to give you an address and a way toconnect to the Internet, but usually not a way for others to connect toyou. If you want to run an Internet server on such a connection yourisk losing your IP address every time you reconnect, or as in the caseof DHCP even when the lease is renegotiated.

By using a DDNS client like inadyn you can register an Internet namewith a DDNS provider, like FreeDNS. TheDDNS client updates your DNS record periodically and/or on demand whenyour IP address changes. Inadyn can maintain multiple host records withthe same IP address, use a combination of a script, the address from anInternet-facing interface, or default to using the IP address changedetector of the DDNS provider.

__
¹ Public IP address is the default, private addresses can also be used.

Supported Providers

Some of these services are free of charge for non-commercial use, sometake a small fee, but also provide more domains to choose from.

DDNS providers not supported natively like http://twoDNS.de, can beenabled using the generic DDNS plugin. See below for configurationexamples.

  • http://www.dyndns.org, http://www.dyn.com

In-A-Dyn defaults to HTTPS, but not all providers may support this, sotry disabling SSL for the update (ssl = false) or the checkip phase(checkip-ssl = false) in the provider section, in case you run intoproblems.

HTTPS is enabled by default since it protects your credentials frombeing snooped and reduces the risk of someone hijacking your account.

Dyndns Setup

Configuration

In-A-Dyn supports updating several DDNS servers, several accounts even ondifferent DDNS providers. The following /etc/inadyn.conf example showhow this can be done. To verify your configuration, without starting thedaemon, use:

This looks for the default .conf file, to check any file, use:

Example

Notice how this configuration file has two different users of the No-IPprovider -- this is achieved by appending a :ID to the provider name.

We also define a custom cache directory, default is to use /var/cache.In our case /mnt is a system specific persistent store for cachingyour IP address as reported to each provider. Inadyn use this to ensureyou are not locked out of your account for excessive updates, which mayhappen if your device Internet gateway running inadyn gets stuck in areboot loop, or similar.

However, for the caching mechanism to be 100% foolproof the system clockmust be set correctly -- if you have issues with the system clock notbeing set properly at boot, e.g. pending receipt of an NTP message, usethe command line option --startup-delay=SEC. To tell inadyn it isOK to proceed before the SEC timeout, use SIGUSR2.

The last system defined is the IPv6 https://tunnelbroker.net serviceprovided by Hurricane Electric. Here hostname is set to the tunnel IDand password must be the Update key found in the Advancedconfiguration tab.

Sometimes the default checkip-server for a DDNS provider can be veryslow to respond, to this end Inadyn now supports overriding this serverwith a custom one, like for custom DDNS provider, or even a customcommand. See the man pages, or the below section, for more information.

Some providers require using a specific browser to send updates, thiscan be worked around using the user-agent = STRING setting, as shownabove. It is available both on a global and on a per-provider level.

NOTE: In a multi-user server setup, make sure to chmod your .confto 600 (read-write only by you/root) to protect against other usersreading your DDNS server credentials.

Custom DDNS Providers

In addition to the default DDNS providers supported by Inadyn, customDDNS providers can be defined in the config file. Use custom {} ininstead of the provider {} section used in examples above.

In-A-Dyn use HTTP basic authentication (base64 encoded) to communicateusername and password to the server. If you do not have a usernameand/or password, you can leave these fields out. Basic authentication,will still be used in communication with the server, but with emptyusername and password.

A DDNS provider like http://twoDNS.de can be setup like this:

For https://www.namecheap.com DDNS can look as follows. Notice howthe hostname syntax differs between these two DDNS providers. You needto investigate details like this yourself when using the generic/customDDNS plugin:

Here three hostnames are updated, one HTTP GET update request for everylisted DDNS server and path is performed, for every listed hostname.Some providers, like FreeDNS, support setting up CNAME records to reducethe amount of records you need to update. Some providers, like FreeDNS,default to link multiple records to the same update, which may be veryconfusing if you want each DNS record to be updated from a unique IPaddress -- make sure to check your settings at the provider!

Your hostname is automatically appended to the end of the ddns-path,as is customary, before it is communicated to the server. Username isyour Namecheap username, and password would be the one given to you inthe Dynamic DNS panel from Namecheap. Here is an alternative config toillustrate how the hostname setting works:

The generic plugin can also be used with providers that require theclient's new IP address in the update request. Here is an example ofhow this can be done if we pretend that http://dyn.com is notsupported by inadyn. The ddns-path differs between providers and issomething you must figure out. The support pages sometimes list thisunder an API section, or similar.

Here a fully custom ddns-path with format specifiers are used, see theinadyn.conf(5) man page for details on this.

When using the generic plugin you should first inspect the response fromthe DDNS provider. By default Inadyn looks for a 200 HTTP response OKcode and the strings 'good', 'OK', 'true', or 'updated' in theHTTP response body. If the DDNS provider returns something else you canadd a list of possible ddns-response = { Arrr, kilroy }, or just asingle ddns-response = Cool -- if your provider does give any responsethen use ddns-response = '.

If your DDNS provider does not provide you with a checkip-server, youcan use other free services, like http://ipify.com

or even use a script or command:

These two settings can also be used in standard provider{} sections.

Note:hostname is required, even if everything is encoded in theddns-path! The given hostname is appended to the ddns-path used forupdates, unless you use append-myip in which case your IP address willbe appended instead. When using append-myip you probably need toencode your DNS hostname in the ddns-path instead, as is done in thelast example above.

Build & Install

Dyndns

In-A-Dyn requires a few libraries to build. The build system searchesfor them, in their required versions, using the pkg-config tool:

  • libConfuse (3.0+)
  • LibreSSL, OpenSSL, or GnuTLS

They are available from most UNIX distributions as pre-built packages.Make sure to install the -dev or -devel package of the distributionpackages when building Inadyn.

When building with HTTPS (SSL/TLS) support, make sure to also installthe ca-certificates package on your system, otherwise Inadyn will notbe able to validate the DDNS provider's HTTPS certificates.

By default inadyn tries to build with GnuTLS for HTTPS support. GnuTLSis the recommended SSL library to use on UNIX distributions which do notprovide OpenSSL as a system library. However, when OpenSSL is availableas a system library, for example in many embedded systems:

To completely disable inadyn HTTPS support:

For more details on the OpenSSL and GNU GPL license issue, see:

RedHat, Fedora, CentOS

On some systems the default configure installation path, /usr/local,is disabled and not searched by tools like ldconfig and pkg-config.So if configure fails to find the libConfuse libraries, or the .pcfiles, create the file /etc/ld.so.conf.d/local.conf with this content:

update the linker cache:

and run the Inadyn configure script like this:

Building from GIT

If you want to contribute, or simply just try out the latest butunreleased features, then you need to know a few things about theGNU build system:

Dyndns

  • configure.ac and a per-directory Makefile.am are key files
  • configure and Makefile.in are generated from autogen.sh
  • Makefile is generated by configure script

To build from GIT you first need to clone the repository and run theautogen.sh script. This requires automake and autoconf to beinstalled on your system.

Building from GIT requires, at least, the previously mentioned librarydependencies. GIT sources are a moving target and are not recommendedfor production systems, unless you know what you are doing!

Origin & References

This is the continuation of Narcis Ilisei's original INADYN. Nowmaintained by Joachim Nilsson. Please file bug reports, or sendpull requests for bug fixes and proposed extensions at GitHub.

Inadyn Dyndns

The problem with this solution is that inadyn does not detect if network is up, and sometimes it updates too much times and server disables your dynamic dns account.
This script works most of the times. It uses dhcp to know when ip has been updated.
#!/bin/sh
# FILE: dhcp3/dhclient-exit-hooks.d/zzz_public_ip
username=*fill in*
password=*fill in*
domain=*fill in*
dns_ip=`host '$domain' |sed -e 's/[A-Za-z. -]* //'`
actual_ip=`wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'`
function test_network_and_ip_on_dns() {
# Some times ping is not allowed :-(
# case `ping -qnc 1 google.com 2>&1` in
# *'100% packet loss'*)
# logger -t publicIP “The network is DOWN.”
# exit 0
# ;;
# esac
NETSTATUS=`wget -O - www.google.com 2>&1 | grep 'Network is unreachable'`
# echo 'NETSTATUS: $NETSTATUS.'
if [ -z '$NETSTATUS' ] || [ ' '$NETSTATUS' ]; then
test_ip_on_dns
else
logger -t publicIP “Network is DOWN.”
exit 0
fi
}
function test_ip_on_dns() {
if [ '$dns_ip' '$actual_ip' ]; then
logger -t publicIP 'Public IP is $actual_ip'
else
logger -t publicIP 'Updating ip for domain $domain with username $username'
/usr/sbin/inadyn --iterations 1 -u $username -p $password -a $domain
logger -t publicIP 'Public IP is $actual_ip'
fi
}
if [ -z '$reason' ]; then
test_network_and_ip_on_dns
exit 0
fi
case '$reason' in
MEDIUM|ARPCHECK|ARPSEND|NBI|BOUND|RENEW|REBIND)
logger -t publicIP 'Updating public IP. Reason: $reason'
test_network_and_ip_on_dns
;;
EXPIRE|FAIL|TIMEOUT|PREINIT|REBOOT|STOP|RELEASE|*)
logger -t publicIP 'Not updating. Reason: $reason'
;;
esac