On 5 Dec 2005,
(E-Mail Removed) <(E-Mail Removed)> wrote:
> I am trying to configure syslog for remote logging on two linux boxes.
> Everything works fine if I add the following line to /etc/hosts:
>
> 172.23.62.12 linux-box1.domain.com
>
> and the syslog.conf reads:
>
> *.emerg @linux-box1.domain.com
I hope you are not really using "domain.com" because that is a registered
domain that can confuse the issue. If you do not have your own registered
domain to use for private IP's, or it is just an example, you should use a
truly bogus domain.
> However, now I want the syslog process to lookup the address
> dynamically instead of the hardcoded IP address in /etc/hosts.
> Therefore, is there a way to:
>
> Just use the /etc/syslog.conf with fully-qualified name as above and
> have the syslog lookup the IP-address and do remote logging? (without
> me inserting the IP-address in the /etc/hosts file?).
If this is for local private IP, why not do your own DNS with local
forward/reverse zones added? But that is easiest if LAN IP's are static.
> Perhaps, even a way to dynamically update entires in /etc/hosts would
> be helpful as well.
If it is a public IP, you could use a dynamic IP service (static name to
dynamic IP mapping). There are many, but I use no-ip.com, updated by
their client automatically from /etc/ppp/ip-up whenever pppoe connects.
I suppose you might be able to use dynamic DNS for private IP's from dhcp
related scripts. But better just to use static LAN IP's and your own DNS
for any local servers.
I use bind9 for local DNS and public caching. But the only remote syslog
I do is from my WAP to local Linux static IP.