Re: How to clean up routing cache?
From: Lon Stowell (LonDot.Stowell_at_ComcastPeriod.Net)
Date: 10/07/03
- Next message: UNIX admin: "Re: SSH"
- Previous message: Jim Cochrane: "Re: grep command and EXACT host entry in /etc/hosts"
- In reply to: Alexandre Patchine: "Re: How to clean up routing cache?"
- Next in thread: Alexandre Patchine: "Re: How to clean up routing cache?"
- Reply: Alexandre Patchine: "Re: How to clean up routing cache?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 07 Oct 2003 17:54:24 GMT
Approximately 10/6/03 23:11, Alexandre Patchine uttered for posterity:
> Ok, I have not explained good enough...
This is not a routing issue, it is a name caching issue.
>
> when I ping some host that does not exist (I know it):
> bash2#ping blade_110.xxx.ericsson.se
> ping: unknown host blade_110.ericsson.se
>
> I get the error message above after 15..20 sec because ping tries to
> reach the host blade_110.xxx.ericsson.se...
No, actually what happens is that your machine tries to
reach a nameserver to find the IP address for that hostname.
And this takes a while on a negative answer.
> When I run the same command second time (after one minute):
>
> bash2#ping blade_110.xxx.ericsson.se
>
> I get error response immediately:
> ping: unknown host blade_110.ericsson.se
Your host has cached the negative answer and therefore
doesn't waste time trying to find the IP address for
that hostname.
And even if your host did not cache the negative answer,
the dns server at ericsson.se [or your isp, etc. etc.]
will have cached the negative answer and will return that
immediately.
You can see this behavior with the nslookup command
run interactively with debug set.
# nslookup [do not enter the hostname here, just the command]
blah blah blah blah, you get a nameserver...
> set d2 [note that you now have a nslookup prompt]
set debug level 2.
> bogus.ip.hostname.co.se enter bad name.
>
> But if I wait one hour (did not measure shortest time) then happens
> like I run it first time, ping command does not return immediately...
>
> My question was that I think the error message stored in some kind of
> cache on OS (looks like error response cached for second time).
> How I clean that cache and where is setting for the timeout of cache?
Why would you want to?
On your host, if solaris, the caching is done by the naming
services caching demon, aka nscd. Man pages on timeouts.
However, your host isn't the only name server timeout involved.
And negative answers in DNS are required to timeout...otherwise
you'd never be able to access newly added hosts.
>
> I need to know the behavior exactly because I am going to use it for
> supervising of some nodes...
What you are really doing is managing the name servers, not those
nodes.
If you really want to know whether they exist, try their IP
address rather than hostname....unless you are really trying
to manage the naming services.
>
> thanks,
> alexandre
>
> patshin@hotmail.com (Alexandre Patchine) wrote in message news:<7c3669b4.0310060600.447a769d@posting.google.com>...
>> Hello!
>>
>> My OS is the Solaris 8
>>
>> When I ping some host that is not alive, first time I get error
>> message after quite long timeout ~15...20 sec...
>>
>> Second time I do it I get error message almost immediately that means
>> the error response is stored somewhere on my computer...
>>
>> If I wait quite long period of time I see that error message again
>> appears after long timeout, that indicates that cache was cleand up...
>>
>> Question: how do I change cache time and where? How can I clean up
>> cache myself?
>>
>> I looked in zillion places and commands and could not find the option
>> to do that...
>>
>> Thanks,
>> Alexandre
- Next message: UNIX admin: "Re: SSH"
- Previous message: Jim Cochrane: "Re: grep command and EXACT host entry in /etc/hosts"
- In reply to: Alexandre Patchine: "Re: How to clean up routing cache?"
- Next in thread: Alexandre Patchine: "Re: How to clean up routing cache?"
- Reply: Alexandre Patchine: "Re: How to clean up routing cache?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|