disable cashing

Kevin Darcy kcd at daimlerchrysler.com
Wed Nov 5 19:31:25 UTC 2003


yossi wrote:

>Kevin Darcy <kcd at daimlerchrysler.com> wrote in message news:<bo96u3$2i8d$1 at sf1.isc.org>...
>  
>
>>yossi wrote:
>>
>>    
>>
>>>phn at icke-reklam.ipsec.nu wrote in message news:<bo6j2e$2hfe$1 at sf1.isc.org>...
>>> 
>>>
>>>      
>>>
>>>>yossi <yossi.zadah at audiocodes.com> wrote:
>>>>   
>>>>
>>>>        
>>>>
>>>>>How I can configure the dns, to disable cashing?  
>>>>>thanks
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>You can't. It's a built in part of the design.
>>>>   
>>>>
>>>>        
>>>>
>>>How can an application actively query the name server in order to
>>>detect the possible change, regardless of the Time To Live (TTL)
>>>associated with the DNS record?
>>>
>>>      
>>>
>>If "the name server" is the master for the zone, then it's a moot point, 
>>since it's already giving the most up-to-date information available.
>>
>>If "the name server" is a slave server, then, short of going out of band 
>>and forcing the slave to refresh, your application is at the mercy of 
>>replication delays.
>>
>>If "the name server" is a non-authoritative (caching) server,then, 
>>again, short of going out of band and forcing the server to purge the 
>>old cache entry, there's no way to make it fetch the new data.
>>
>>Of course, if your application is smart enough, it can try to find the 
>>master server itself. But the master server might be "hidden", i.e. it 
>>might be behind a firewall and not even on the same network as wherever 
>>your app lives. So there are no guarantees here.
>>
>>                                                                         
>>                                    - Kevin
>>
>>
>>                                                                         
>>                                       - Kevin
>>    
>>
>
>Thank you all for the detailed answer. 
>To be more specific, 
>
>my OS is:
>
># uname -a
>SunOS client65 5.8 Generic_108528-07 sun4u sparc
>SUNW,UltraSPARCengine_CP-60
>
>In order to activate DNS I made two modifications as follows: 
>In the file resolv.conf:
>nameserver 192.168.101.6 (DNS server IP)
>
>and in the file : 
># /etc/nsswitch.files:
>hosts:      files dns	## <--- Change here
>
>My understanding in DNS is very limited; I assume that I am working in
>a "slave server mode".
>
I wouldn't assume that. Look at your nameserver configuration. It should 
be in /etc/named.conf. Chances are your box is just a caching 
nameserver. If it were a slave, then it's fairly likely that it would 
take even *longer* than the TTL period for changes to be visible on your 
nameserver instance (or at least that the speed of propagation -- 
whether that be slower or faster -- would have little relation to the 
TTL value).

>In my application I am working with ' gethostbyname', it is very
>convenient since then I don't have to take care of TTL. The only
>problem is where I need to make a query regardless the TTL, calling 
>'gethostbyname'  will return the answer (from the cash) since the last
>query, which have been initiated as a result of TTL epoch (no new
>query).
>
>I can use the res_nquery to force query whenever it is needed, but
>then I will need to take care of the TTL.
>
>I thought that it is a good idea to combine these two commands, the
>problem with that is: res_nquery doesn't refresh the 'gethostbyname'
>tables.
>
>How I can to make the slave to refresh?
>
*If* this is a slave nameserver, you'd have to have administrative 
privileges and issue an "ndc reload" (for a BIND 8 nameserver) or "rndc 
refresh <zone>" (for a BIND 9 nameserver). If you don't have 
administrative privileges, then you're basically out of luck.

>How I can force the DNS to issue a query whenever I calling
>gethostbyname'?
>
You can't. That's not part of the gethostbyname() interface and, in any 
case, it would require administrative privileges.

Hopefully you understand that the caching function is deeply integrated 
into DNS, and what you are trying to do -- basically, bypass caching -- 
is very unusual and unsupported. If the data you're currently trying to 
retrieve from DNS is very volatile, then perhaps it shouldn't be in DNS 
in the first place. Use some other kind of database.

                                                                         
                     - Kevin





More information about the bind-users mailing list