in reply to Re: Nagios plugin to detect changed IP address of WRT54G router. - TIMTOWTDI
in thread Nagios plugin to detect changed IP address of WRT54G router.

Your suggestion has merit. It does however miss the point of why I do what I do. My MX is for the domain that I have registered to myself. I don't want "dyndns" in the middle somwhere. I already pay folks for the privelege of using their machine to host my website, so why not also let them host my CNAME and MX?

The good news is the DHCP assigned address changes infrequently enough that this approach that I'm using isn't a major PITA. If it ever became such I'd re-review my options and possibly implement something along the lines of what you suggest. When I first started hosting my own mailserver and farming out my MX DNS entry DynDNS was not an ooption.

In fact, the incidence of my IP address changing happens so infrequently that I've even considered adding to this script (and it's predecessor which wasn't as nice as this one) logic to automatically create the trouble ticket with my hosting provider for them to update the DNS entry.

I'm just waiting for the day when T1 lines become "affordable" and I can host my whole domain myself. Yeah... right... dream on...


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
  • Comment on Re^2: Nagios plugin to detect changed IP address of WRT54G router. - TIMTOWTDI

Replies are listed 'Best First'.
Re^3: Nagios plugin to detect changed IP address of WRT54G router. - TIMTOWTDI
by z3d (Scribe) on Feb 27, 2006 at 22:14 UTC
    Cheap but equally sad solution I used once in a similar situation was to have a cron hit a page on my external website every X minutes/hours - then update my external records as needed via the ping-page.



    "I have never written bad code. There are merely unanticipated features."
Re^3: Nagios plugin to detect changed IP address of WRT54G router. - TIMTOWTDI
by beachbum (Beadle) on Feb 27, 2006 at 17:05 UTC

    I also use dyndns, and find it to work wonderfully for my purposes (with my own domains as well).

    With Tom's suggestion you will not need to receive at email@yourdomain.dyndns.org, you will still be able to accept mail at email@yourdomain.com.

    The changes at your dns host would look something like this:

    OLD: www.yourdomain.com. IN A 111.222.111 (static ip of webserver) emailserver.yourdomain.com. IN CNAME homecomputer.yourdomain.com. homecomputer.yourdomain.com. IN A 222.111.222 (dynamic ip) yourdomain.com. IN MX 10 emailserver.yourdomain.com. NEW: www.yourdomain.com. IN A 111.222.111 (static ip of webserver) emailserver.yourdomain.com. IN CNAME uniquename.dyndns.org. yourdomain.com. IN MX 10 emailserver.yourdomain.com.

    In the NEW: example, your dns host no longer needs to update any ip addresses. DynDNS would have a record that looks something like this:

    uniquename.dyndns.org. IN A 222.111.222 (dynamic ip)
    You would run a DynDNS client (Perl script?) that automatically updates that ip address as it changes.

    With dyndns.org keeping track of your routable ip address, your dns host only needs to know that they can reach that server at uniquename.dyndns.org.

    This will allow you to sit back and relax, knowing that even if your ip address changes everyday, email@yourdomain.com will still be delivered to your email server without you having to call anyone.

    FWIW, the last router (Netgear) I bought for my house has a DynDNS client installed on it, so I don't need to run the client on one of my computers.

      1. Most of the scripts I've seen so far to do such IP updates were written in perl of course :-)
      2. Getting a router with built-in support for services like DynDNS, No-IP.info or others is the best choice, as the IP is set a few seconds after the IP changes...
      3. We have drifted away from the basic topic... Perl is a matter of choice and the ability to code the working solution - blue_cowdawg has just shown us that!

      Greetz, Tom.
Re^3: Nagios plugin to detect changed IP address of WRT54G router. - TIMTOWTDI
by tmiklas (Hermit) on Feb 27, 2006 at 15:57 UTC
    Of course i agree 100% with your oppinion... i had the same situation here. I hope you did not get me wrong - the easiest way to express my point of view is TIMTOWTDI - nothing more. Leaving your A and MX records to guys at DynDNS has some more concerns (like security... for paranoid people) and lots more... Anyway it does not change my oppinion that I like your code shown above - it has already helped me today with another problem :-)

    Cheers, Tom.
      Leaving your A and MX records to guys at DynDNS has some more concerns (like security... for paranoid people) and lots more...

      Isn't the fact that your IP address could suddenly change a security problem as well? You could quite easily have attempts to deliver mail to the wrong place. There is no guaranty that everyone's DNS servers will honor very short TTL.

      If security isn't a concern, your WRT54G already has software that will update your records at dyndns.org immediately after the IP changes. I did not see anyone mention that.

      This might be off topic, but why do so many people insist on running mail servers at home? Most cable modem and DSL IP ranges are on a lot of mail servers blacklists, for one thing. Reliability isn't terribly high, either. You can get a small and reliable virtual server for $10 a month (or less), and the box you are on will likely have connectivity through more than one large ISP (my provider seems to have 6 very high speed connections.

      Oknow
Re^3: Nagios plugin to detect changed IP address of WRT54G router. - TIMTOWTDI
by Anonymous Monk on Mar 30, 2006 at 23:30 UTC
    The #1 reason to have your DNS and Other Services hosted by separate entities.... If your Service Provider flakes out with webhosting ( say, a DDOS attack... ) *YOU* can redirect *YOUR* traffic away from them without any intervention on *THEIR* part... Control Am Good.