[LinuxUsers] Dynamic Public ip readdressing ......
Peter Manis
manis at digital39.com
Sat Apr 11 14:23:28 UTC 2009
I've heard mention that the ifup scripts will be run when DHCP updates the
dynamic address, but I have never checked. If it does that might be a good
place to put the code. Otherwise using grep/awk on the ifconfig output and
then comparing that to a file would work. If the IP is not the same, update
hosts, and then update the file you are comparing against.
On Sat, Apr 11, 2009 at 9:18 AM, Chris Penn <cantormath at gmail.com> wrote:
> This isn't a smart thing to do, but I want to know if I can do it.
> I have a server that has a public IP address, but it is not static.
> Im trying to think of a way to update the /etc/hosts file when this Ip
> changes.
> It does change often, but it does change from time to time, since this
> machine is IP is technically labeled as a workstation.
> I realize that when it changes I will need to reset certain services.......
>
> Does anyone have any ideas? I can write the ip address to a file, but
> can I get /etc/hosts to read from that file?
> I think that is a way to do it, but I'm not sure. Do I need to
> install bind? I need to man hosts more.....
>
> chris...
>
> --
> "As we open our newspapers or watch our television screens, we seem to
> be continually assaulted by the fruits of Mankind's stupidity."
> -Roger Penrose
> _______________________________________________
> LinuxUsers mailing list
> LinuxUsers at socallinux.org
> http://socallinux.org/cgi-bin/mailman/listinfo/linuxusers
>
--
Peter Manis
(678) 269-7979
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://socallinux.org/pipermail/linuxusers/attachments/20090411/06c739ca/attachment.htm>
More information about the LinuxUsers
mailing list