Koozali.org: home of the SME Server

[SME 7.1] DynDNS update only once per week?

mid

[SME 7.1] DynDNS update only once per week?
« on: January 16, 2007, 02:13:28 PM »
Hello,

I'm currently testing SME Server 7.1 and tried to use the free DynDNS service at dyndns.org. As you can imagine from this posting, I have some difficulties and am looking for a solution or at least approval.

The server gets its external IP from the DHCP server of my provider (direct LAN connection) and is configured as "Server and Gateway" via the admin console -- using my full dyndns hostname as hostname for the SME-Server. When configuring DynDNS, I selected dyndns.org as service.

As far as I can see, my setup is okay -- when calling /sbin/e-smith/dynamic-dns/dyndns.org with the appropriate parameters (my own IP, username as set up, password as set up, hostname as set up), DynDNS changes my IP adress as expected. This proves, the password is correct, the username and hostname as well, DynDNS is working and satisfied with my data, and we have a working internet connection.

Step two, calling /etc/e-smith/events/actions/update-dns manually, works great as well. The DynDNS records were updated -- this proves, that my settings in the configuration database are correct and I have set up the correct hostname, due update-dns reads its data directly from the E-Smith DB.

Now I do a reboot of the SME-Server. When the machine gets back again, the DynDNS record is not updated. There is still the old IP adress from the last system start. I've added some debugging labels to the scripts update-dns and dyndns.org telling me every time they're started and with which command line options -- and noticed that none of the two scripts seems to be started during the boot process.

I was searching for the script which calls update-dns, and could only find /etc/cron.weekly/refresh-ddns. If I got it right, this means the DynDNS record is only updated once a week, every Sunday at 4:22 am.

I also found a symbolic link at /etc/e-smith/events/ip-change/S85update-dns pointing to the update-dns script. I would expect this to be executed every time the DHCP client returns an IP -- but according to my debugging and to the syslog, this symlink is not called on system startup. There is no event ip-change, nor any event ip-up, during the startup (according to syslog). Only when the DHCP server gives the SME-Server a new IP while the system is running.

Is this intended so, or did I do something wrong? Or do we have a missing symlink somewhere in the event handling or so?

Greetings, Mirko

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
[SME 7.1] DynDNS update only once per week?
« Reply #1 on: January 16, 2007, 03:10:16 PM »
Straight after a reboot, try
Code: [Select]
cd /var/log
more messages | grep S85


The above for me does show S85update-dns running on both 7.0 and 7.1 in server-gateway mode.

Code: [Select]
Jan 17 01:16:26 sme71 esmith::event[3254]: Running event handler: /etc/e-smith/events/ip-change/S85update-dns
Jan 17 01:16:47 sme71 esmith::event[3254]: S85update-dns=action|Event|ip-change|Action|S85update-dns|Start|1168956986 362334|End|1168957007 521051|Elapsed|21.158717
Regards,
William

IF I give advise.. It's only if it was me....

mid

[SME 7.1] DynDNS update only once per week?
« Reply #2 on: January 16, 2007, 03:23:59 PM »
grep returns nothing when searching for "S85" in /var/log/messages.

As I said, S85update-dns is not executed during system start -- obviously because there is no event "ip-change". There's not even an event "ip-up".

Okay, perhaps I can check the other side of the problem: Who is responsible for generating the events ip-change, ip-up and so on? Which script or which situation? I just checked the dhclient-script, obviously it's not generating any events.

Greetings, Mirko

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
[SME 7.1] DynDNS update only once per week?
« Reply #3 on: January 16, 2007, 03:46:56 PM »
Quote from: "mid"
grep returns nothing when searching for "S85" in /var/log/messages.

As I said, S85update-dns is not executed during system start -- obviously because there is no event "ip-change". There's not even an event "ip-up".

Okay, perhaps I can check the other side of the problem: Who is responsible for generating the events ip-change, ip-up and so on? Which script or which situation? I just checked the dhclient-script, obviously it's not generating any events.

Greetings, Mirko


As people keep saying, if it ain't working how you think it should, take it to the bug tracker.
Bug 1703
Regards,
William

IF I give advise.. It's only if it was me....

mid

[SME 7.1] DynDNS update only once per week?
« Reply #4 on: January 16, 2007, 04:14:31 PM »
Quote from: "william_syd"
As people keep saying, if it ain't working how you think it should, take it to the bug tracker.

... I like to find out first if it's really a bug, or if it's -- as most common -- just my very own mistake. Devellopers shouldn't waste their time with configuration errors made up as bug reports.

That's why I'm asking if this is intended that way or not, or if I just made a horrible mistake.

The question in the bug report you linked (thanks!) is just the same: Why no update at boot time? Sadly, there's bo answer in that report.

Perhaps could someone send me a link or so where I can find out more about generating an event or who normally generates ip-change, ip-up and so on. Then I'd perhaps be able to help myself (and others).

Greetings, Mirko

mid

Solved...
« Reply #5 on: January 16, 2007, 04:58:04 PM »
Thanks for your help, I found it myself. It's just designed too intelligent, with some minor problems in some cases.

I'll point it out and describe what I found later. So far, it's no bug, more details later on.

Greetings Mirko

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Solved...
« Reply #6 on: January 16, 2007, 05:24:46 PM »
Quote from: "mid"
Thanks for your help, I found it myself. It's just designed too intelligent, with some minor problems in some cases.

I'll point it out and describe what I found later. So far, it's no bug, more details later on.


There's a bug open (1703), with link in the earlier posting by william_syd. Please help others by posting your observations to that bug.

mid

[SME 7.1] DynDNS update only once per week?
« Reply #7 on: January 17, 2007, 12:29:27 AM »
Hello,

here's now what I found. I'll also post a bug report later.

It's quite normal that the SME Server does not update the DynDNS records due the boot process -- because there is, from the point of view of SME Server, no need for.

SME Server stores the external IP address it was given at the last DHCP request. At the next boot, SME requests for an IP again. If the DHCP server sends the same IP address than before, there is no change of the IP address for the server, so SME don't generate the event ip-change -- because no service or configuration file needs any update, everything is like before.

When the SME server is connected directly to an internet provider via DSL or LAN and gets always the same IP address (e.g., static IP), everything is fine and the DynDNS record needs no update either -- so only the cron job running once a week on Sunday, 4:22 am, updates the record regularly so the DynDNS hostname don't get deleted because it's obviously unused. If the DHCP server changes its mind and sends a new IP, SME generates the ip-change event, updates the config files and the DynDNS entry, so it's ensured that the DynDNS hostname points always to the SME Server.

But when the SME Server resides behind a router, e.g. a Fritzbox configured to make some SME services available trough port forwarding, and you use some kind of dynamic DNS service which retrieves your IP address from the update request you send, you need DynDNS updates very time you make a new internet connection. In that case, you should use your router for the dynamic DNS updates -- this is the only device which knows when your external IP address has changed.

There is another problem: When you left out the dynamic DNS configuration when configuring SME Server at first, or if you made any typing error at the DynDNS username or password or there is no internet connection when you configure the server first.

At the first bootup, the configuration script asks for several network settings, including the dynamic DNS service. If you enable the dynamic DNS at this point, the first startup, the SME server detects an ip-change because of the initial configuration of your network devices and updates the DynDNS records as desired. After that, a reconfiguration is only required if the external IP address of the SME Server changes -- or on Sunday to keep the DynDNS hostname. But SME Server does not check if the initial call of update-dns was successfull -- if you have a typing error in the username or password of the DynDNS account, or there was for any reason no internet connection or any problem doing the record update, you face exactly the same problems as if you configure DynDNS later on. That's the first thing I call a bug.

If you reconfigure your server later and add the dynamic DNS feature, SME Server configures everything -- but there is no ip-change event! Therefor, SME Server does not update the DynDNS record after the config script ends -- it waits for the next IP address change or next sunday. This means, your DynDNS hostname does not point to your server, and the admin wonders why. Of course, he'll fiddle around with the DynDNS configuration -- but this will not help, SME waits for the ip-change signal. I call this a bug and will report it.

The easy workaround is, to call "signal-event ip-change" after configuring the dynamic DNS feature, or to call /etc/e-smith/events/action/update-dns instead. Both will work.

One, possibly false, assumption SME Server makes is, that the DynDNS records will never change outside of SME Server. To ensure that the DynDNS record really points to the IP of the external address, SME should check every time the device is bound or rebound to an IP address where the DynDNS hostname is pointing to. This is the only relieable method. I suggest to add this check and the possibly needed update-dns call in one of the next versions of SME Server.

Greetings, Mirko

mid

Re: Solved...
« Reply #8 on: January 17, 2007, 01:15:51 AM »
Hello Charlie,

Quote from: "CharlieBrady"
There's a bug open (1703), with link in the earlier posting by william_syd. Please help others by posting your observations to that bug.

OK, I comment this one -- allthough it was initially reported as problem with updating dyndns.com, and my report (and most of the bugreport 1703) depends on dyndns.org. Both services has their own script. Please consider to move my report/observations into a new bugreport, if it does not fit.

Thanks, Mirko