monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DNS cache?


From: Jan-Henrik Haukeland
Subject: Re: DNS cache?
Date: Tue, 25 Jan 2005 06:44:42 +0100


On Jan 25, 2005, at 0:22, Jonathan Trott wrote:

I am monitoring a remote web cluster using monit. The cluster is connected
using multiple ADSL connections and the load is distributed using round
robin DNS with a TTL of 0. The problem is that when I test http using the DNS name in monit, it appears to cache the DNS response the first time it
starts up and doesn't refresh the record.

Actually monit does not cache the host name. Each socket connection use gethostbyname() to lookup the host. However caching can occur in this function since it use a name server to resolve the host name. Without picking up my copy of Stevens and investigate this further I have simply peppered the network code with endhostent() after gethostbyname() is used. This may or may not fix the problem. Please check out the monit code from CVS using the instructions here http://savannah.nongnu.org/cvs/?group=monit and use anonymous access to checkout.

Please let us know if this fix the problem, otherwise we'll just have to dig deeper :)

Ps. Also check that your name server really does return different ip-addresses on lookup.

--
Jan-Henrik Haukeland
Mobil +47 97141255





reply via email to

[Prev in Thread] Current Thread [Next in Thread]