Re: Refreshing DNS/Cache? ??

From: Clifton Royston <cliftonr@dont-contact.us>
Date: Wed, 26 Jan 2000 17:21:01 -1000

On Thu, Jan 27, 2000 at 11:32:48AM +1100, Ben Mckellar wrote:
> I changed a DNS entry. I changed the IP for a www.something.com site. And
> then i went to my browser and typed the site in and it didnt come up.. i
> turned off squid so i had a direct connect and it worked fine.
>
> In the end i stopped and started squid and it work fine.
>
> Does this mean i will have to stop and start squid every time i change a dns
> entry? can i change the refresh time ? help

  This is a somewhat known gotcha. There are at least 4 layers of
caching potentially involved and at issue here.

1) DNS cached in your name servers' Time-to-live values. If you're
authoritative, and you update/reload your name server e.g. Bind, that
solves that.

2) DNS lookup results (IP values) cached within Squid's dnsserver
processes. These get stopped and restarted when you do a squid -k
reconfigure.

3) DNS lookup results (IP values) cached within Squid itself. These
only get cleared when you restart Squid unless you apply one of Henrik
Nordstrom's patches. IMHO, this is an important one for any ISPs using
Squid who also host domains on their network.

4) The contents of the web site potentially stored in your cache
itself. As these are indexed by the URLs, if you change the IP to
point to the new address, Squid will not see any difference and will
return pages from the old site.

  My suggestions for dealing with the first 3 are: point Squid to the
most up-to-date name server on your network (or to one which is
automatically slaved to your authoritative files), apply Henrik's patch
which will cause all of Squid's internal IP addresses to be flushed
when you reconfigure, and then work it into your admin routine to do a
squid -k reconfigure every time you update DNS. I'm working on scripts
to automate that for our site, but those will be very dependent on how
a given site is administered.

  For the last issue, I have almost finished my cache-crawler script,
which will scan through the cache contents (as determined by the
squid.conf file) and allow you to find files by URL and execute
commands for the files it finds. That's so that we can readily purge
domains for web sites which move onto our network, since usually the
customers want to be able to see ASAP that the site has actually moved.
I'll post a note to the list when I'm ready for testers, since there
was some past interest.

  -- Clifton

-- 
 Clifton Royston  --  LavaNet Systems Architect --  cliftonr@lava.net
        "An absolute monarch would be absolutely wise and good.  
           But no man is strong enough to have no interest.  
             Therefore the best king would be Pure Chance.  
              It is Pure Chance that rules the Universe; 
          therefore, and only therefore, life is good." - AC
Received on Thu Jan 27 2000 - 00:01:23 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:50:44 MST