Web lists-archives.com

Re: Simple Linux to Linux(Debian) email




Mark Fletcher wrote: 
> On Tue, Apr 09, 2019 at 02:34:30AM +0200, Jan Claeys wrote:
> > On Mon, 2019-04-08 at 21:33 +0900, Mark Fletcher wrote:
> > > I've created a very simple script that is capable of parsing the
> > > output of "ip addr" and comparing the returned ip address for the
> > > relevant interface to a stored ip address, and thus being able to
> > > tell if the IP address has changed. What I'd like to do now is make a
> > > means for the LFS box to be able to notify me of the fact that the
> > > external-facing IP address has changed. 
> > 
> > Why not use a dynamic DNS provider?
> > 
> > 
> Primarily because it wouldn't solve my problem. IIUC it would allow me 
> to map a domain name to the IP address assigned to my home internet 
> connection. That means that when the IP address assigned to my internet 
> connection changes, I can simply alter the mapping and my VPN clients 
> start working again, without any configuration change on them. Great, 
> but that isn't the problem. The problem is how I know that the IP 
> address has changed and hence the DNS mapping needs updating. I don't 
> see any way that a dynamic DNS service is going to know when my ISP 
> arbitrarily re-assigns my IP. I need the machine that is being assigned 
> the IP address to be able to tell me when it changes, and that is what 
> this thread was about (specifically the "how it would be able to tell 
> me" -- I'd figured out the "how it would know" for myself).

... if the IP address is being changed by DHCP, do you suppose
your dhcp client has a hook to tell other things about it?

man dhclient-script

...
 After all processing has completed,  /sbin/dhclient-script checks  for
 the  presence  of  an  executable /etc/dhcp/dhclient-exit-hooks script,
 which if present is invoked using  the  '.'  command.  All  executable
 scripts  in  /etc/dhcp/dhclient-exit-hooks.d/*  are also invoked.
...

Not to mention:

man ddclient

...
DESCRIPTION
       A perl based client to update your dynamic IP address at
       DynDNS.com (or other dynamic DNS services such as Hammernode,
       Zoneedit or EasyDNS), thus allowing you and others to use a fixed
       hostname (myhost.dyndns.org) to access your machine.  This client
       supports both the dynamic and (near) static services, MX setting,
       and alternative host. It caches the address, and only attempts
       the update if the address actually changes.
...


-dsr-