How To Update DynDNS Server Immediately After xDSL Reconnection on Linux And Fast xDSL Reconnection

By Angsuman Chakraborty, Gaea News Network
Saturday, April 21, 2007

ADSL conenctions are flaky in Calcuta. They tend to go out often and stay off for prolonged periods. However whenever they come back I want to reconnect immediately and also update DynDNS servers so they point to proper IP address. On windows this happens automatically. However on Linux the only client available (the API is simple, you can write one yourself easily) is inadyn which updates, if necessary, periodcially, say every 10 minutes. Secondly inadyn once run, continues to run by default, checking for changes every n minutes. I don’t want to check every n minutes. What I really want is to check DSL connection every minute to see if its up. If the connection went down then I want to reconnect immediately and then update the DNS dyndns server. I want to comply with their policies and update once every 15 days to prevent the domain from expiring, even if the IP address remains same.

ifup is a script which can bring up your xDSL link. The command is:
/sbin/ifup ppp0
Note: ppp0 is the name of your ppp connection, ppp0 by default.
ifup returns true if the connection was down and it successfully brought it back up. Otherwise it returns false. This is a very important capability. The only time I need to update my server is when the xDSL connection was down and it was successfully brought up. So I can simply run this script every minute:
/sbin/ifup ppp0 && /usr/sbin/inadyn

The crontab entry to make this happen looks like this on my system:
* * * * * /sbin/ifup ppp0 && /usr/sbin/inadyn
1 1 1,15 * * /usr/sbin/inadyn

The problem is that inadyn continues to run by default. So I modified the /etc/inadyn.conf to make it run only once. My inadyn.conf file looks like this:
username
password alias
alias

dyndns_system dyndns@dyndns.org
iterations 1

Note the last line where I set the iterations to only one. The defaul is zero, which stands for infinite iterations.

To summarize the end result I achieved is that my ADSL link is checked every minute and brought up, if down. At the same time dyndns is updated with my new address, only if changed. Also dyndns is updated every 15 days, irerspective of any change to ip address.

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :