From: "Ludovic Courtès" <ludo@gnu.org>
To: Trevor Vallender <trevor@tsvallender.co.uk>
Cc: help-guix@gnu.org
Subject: Re: Configuring nscd cache for mDNS
Date: Fri, 18 Nov 2022 17:47:31 +0100 [thread overview]
Message-ID: <87leo89plo.fsf@gnu.org> (raw)
In-Reply-To: <f2fa17a5-1223-4f76-ac90-75abd98b71cb@tsvallender.co.uk> (Trevor Vallender's message of "Mon, 07 Nov 2022 17:33:44 +0000 (UTC)")
Hi Trevor,
Trevor Vallender <trevor@tsvallender.co.uk> 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:
(operating-system
;; …
(services
(modify-services %base-services ;or ‘%desktop-services’, etc.
(nscd-service-type
config => (nscd-configuration
(inherit config)
(caches '())))))) ;zero caches
More details here:
https://guix.gnu.org/manual/devel/en/html_node/Base-Services.html#index-nscd_002dconfiguration
HTH!
Ludo’.
prev parent reply other threads:[~2022-11-18 16:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-07 17:33 Configuring nscd cache for mDNS Trevor Vallender
2022-11-18 16:47 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87leo89plo.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=help-guix@gnu.org \
--cc=trevor@tsvallender.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).