# dyndns.org -- updating every 28 days [solved]

## grimshaw

I am using dyndnupdate and it does work.

I added it to my dhcpcd.exe script so it is run whenever my IP address changes.   I know some folks add a check to cron, whatever floats your boat. 

/etc/dhcpc/dhcpcd.exe

```

IPADDR=`ifconfig eth0 |grep inet|cut -d: -f2|cut -d" " -f1`

# update DNYDNS1

dyndnsupdate -d -a $IPADDR -h host.homeip.net -l -u user:pass

```

However, dyndnsupdate seems to have a minor shortcoming.  My IP address doesn't change often because I pretty much don't reboot.  Only extended power outages knock me off and my ISP only occasionally stops me from renewing the same lease.   So, my IP address probably changes twice a year (give or take).

The DYNDNS folks want you to update, quite specifically, every 28 days.  After a minor grace period they will delete your hostname. 

The dyndnsupdate program does not keep track of the date of the last change and it does not automatically update for you in 28 days.

A cron job (or atjob) is not practical to run the dyndnsupdate with a "-f" as my DHCPCD could have changed at some earlier time (thereby resetting the 28 day cycle and invalidating the next scheduled job).

So, what update clients are other people using to solve this 28 days cycle problem?  Has anyone done something clever with dyndnsupdate to meet this need?

- John

ps - Please don't tell me to read my email and update whenever I get a reminder.  I'm trying to AUTOMATE this process.  My account was deleted in 2003 when I went out of town for Christmas because I wasn't at home to read these reminders.

[/code]

----------

## mirko_3

I'm sorry I can't help you, but I use no-ip, and use the small program (in portage) that updates the ip more than once per hour... is there no such thing for dyndns?

----------

## banadushi

WHy not just make a cron entry to update it every week or so.  Or if you want to prove to them how useless it is to force an update, every minute.

----------

## nevynxxx

emerge ez-ipupdate, it has a sample config for dyndns. I have it set as a boot service. A deamon then runs and when you ip address changes it updates the dyndns service. I've been running like that for a few months now and it seems to work niclel. It has configs for all the major DNS providers too. Just make sure you set-up the cache properly, otherwise it thinks you ip has changed every time it checks (every 5 mins for so) and you get banned by dyndns! the config explains everything though. 

I currently use this so my mail server has a name no matter what and so I can ssh into the box on a daily basis.

----------

## grimshaw

There is no point to updating if nothing changes.  So, updating every minute or every hour is pretty useless on its face.  Not to mention it will flag me as an "abuser" (and lock me out) if my address hasn't changed and I request an update.  The exception is that that want to ensure that the DNS records they are hosting are valid, so I need to actually do one update (even if my IP is the same) every 28 days.

The folks at dyndns.org were flooded with "solutions" cronned to run every few minutes early on which wasted their computing and bandwidth resources with floods of useless updates. 

Quite frankly, I'm glad they quarantine abusers of the system.  It shows they have competant admins who know something about maintenance.   I'm confident that their well maintained service will always stay up and not drown from bad client behavior.

Considering that their service is free, I don't mind updating at the appropriate time.  Considering they understand a thing or two about system maintenance, I want to keep using their system and *not* switch to another one.

So, I want to update every 28 days (in addition to my already working update which runs whnenver my ip changes) that is dynamic enough to check the last changed time.

- John

----------

## grimshaw

 *nevynxxx wrote:*   

> emerge ez-ipupdate, it has a sample config for dyndns. I have it set as a boot service. A deamon then runs and when you ip address changes it updates the dyndns service. 

 

Does it check the date and force an update after 28 days?

- John

----------

## nevynxxx

When its set up right it checks your IP every minute, only updates if it changes. I'm not sure about the 28day thing. I havnt lost my name yet so it might do. Im sure it will be able to be set up to do that though.

The only time it sends an update every minute is when its set up wrong, which you'll find out about pretty quickly!

<edit>  

Just checked the help

-M, --max-interval <# of sec> max time in between updates

mine is set to max-interval=2073600 in the config

</edit>

----------

## teknomage1

depending on your coding skills, you could make a perl/python script that stores your ip address in a file, runs the dyndns update program, puts in a cron entry based on the 28 day cycle (starting to soud like biology...), and then checks your ip address each day and decides whether it needs to go back to step 1.

----------

## r.j.hall

why not have the dhcp script take the variable that ifconfig returns and cat it to a file rather than have the dyndnsupdate script executed from here.

then just have a cron script executed at whatever frequency you like which looks at this file for the current IP address and executes the dyndnsupdate with the value in this file.   Then cat to another file the last ip address sent and the unix time returned by the command "date +%s"  (without the "").   have this script check if the IP's are different or the date recorded in the file is more than 2419200 seconds different from the current date (28 days in seconds), run the dyndsupdate program. 

I am assuming that the dhcp script executes when the dhcp issues a new IP as well as the same IP at the end of a lease, you could just ensure the lease time on your dhcp server was less than 28 days then the program would get run with each lease refresh and the people at dyndns would be happy, and you wouldn't have to bother doing any scripting.

----------

## grimshaw

The last couple of posts are quite correct in terms of solving the problem through a functional methodology.

I didn't know if dyndnsupdate could run as a daemon checking the IP age nor did I know if it would run some sort of cron process to perform the steps mentioned.  I hoped it would just to save myself time athough the docs did not seem to mention it.

I have since discovered that ez-ipupdate functions in this 28-day-update capacity and is also included in the portage tree (too bad I didn't ask my friend who is using it first).

I appreciate the intelligent responses.

Cheers.

- John

----------

