[Top][All Lists]

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

Re: Configuring nscd cache for mDNS

From: Ludovic Courtès
Subject: Re: Configuring nscd cache for mDNS
Date: Fri, 18 Nov 2022 17:47:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi Trevor,

Trevor Vallender <> skribis:

> I have a Docker container which advertises its name using mDNS,
> e.g. hostname.local. However, when I restart the container,
> Docker assigns the container a new IP (not sure why, doesn't
> happen on other distros but that's probably not the point
> here). nscd has the old IP cached and doesn't refresh even though
> the container is advertising the new IP. I'm not sure why this
> behaviour is occurring, or if it is the expected behaviour?

I think so.

> I'm don't know the correct fix here but am open to suggestions. I
> presume one of the following:
> - Configure nscd not to cache mDNS addresses
> - Shorten the length of time these addresses are cached for
> If someone could suggest why this is occurring, or provide an
> example of how to do one of the above, that would be brilliant.

You can clear nscd’s host name cache with:

  sudo herd invalidate nscd hosts

Better, you can configure nscd to disable caching along these lines:

    ;; …
      (modify-services %base-services  ;or ‘%desktop-services’, etc.
         config => (nscd-configuration
                     (inherit config)
                     (caches '()))))))   ;zero caches

More details here:



reply via email to

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