[syslog-ng] strange thing
Stefan Seufert
seuf@ccsw.de
Mon, 1 May 2000 00:26:57 +0200
> > Some sort of "private" hosts file for syslog-ng? Let's say
> > /etc/syslog-ng/syslog-ng.hosts with an "ip\thost" format (even simpler than
> > /etc/hosts), e.g.:
> >
> > 127.0.0.1 localhost
> > 192.168.1.1 host1
> > 192.168.1.2 host2
> > 192.168.1.3 host3
> > 192.168.1.4 host4
> >
> > It shouldn't be very hard to implement a new option which allows you to use
> > this file (and only this file) as the source of name resolution.
> > If an IP is
> > found, great if not we'll resort to the ip. This makes us
> > independent from any
> > name service problems (not only outages, syslog-ng will use the correct
> > hostname, even if someone spoofes your nameserver)
> >
> > In my eyes, something worth thinking about. Maybe I'll have some
> > free minutes
> > tomorrow giving this a try.
>
> I've found an internal glibc 2.1 function which would allow exactly this,
> but using the system's /etc/hosts file. This would add a dependency on glibc
> though, and could also mean that a future glibc would become incompatible.
Too bad my system is still libc :( I'd really like an universal solution, not
depending on some a specifiy version of a specific library.
> This example shows how it looks like:
>
[...]
> __nss_configure_lookup("hosts", "files");
[...]
That's really easy. Although this does not solve my problem (as already said:
libc) it seems to cry after being turned in an option for syslog-ng:
options
[...]
nss_lookup("files");
};
Meanwhile I'll give an other solution a try bypassing the resolver lib.
Stefan