From: Jeff Layton <jlayton@kernel.org>
To: David Howells <dhowells@redhat.com>,
linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org
Cc: keyrings@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, fweimer@redhat.com
Subject: Re: What's a good default TTL for DNS keys in the kernel
Date: Tue, 14 Apr 2020 16:16:05 -0400 [thread overview]
Message-ID: <e751977dac616d93806d98f4ad3ce144bb1eb244.camel@kernel.org> (raw)
In-Reply-To: <3865908.1586874010@warthog.procyon.org.uk>
On Tue, 2020-04-14 at 15:20 +0100, David Howells wrote:
> Since key.dns_resolver isn't given a TTL for the address information obtained
> for getaddrinfo(), no expiry is set on dns_resolver keys in the kernel for
> NFS, CIFS or Ceph. AFS gets one if it looks up a cell SRV or AFSDB record
> because that is looked up in the DNS directly, but it doesn't look up A or
> AAAA records, so doesn't get an expiry for the addresses themselves.
>
> I've previously asked the libc folks if there's a way to get this information
> exposed in struct addrinfo, but I don't think that ended up going anywhere -
> and, in any case, would take a few years to work through the system.
>
> For the moment, I think I should put a default on any dns_resolver keys and
> have it applied either by the kernel (configurable with a /proc/sys/ setting)
> or by the key.dnf_resolver program (configurable with an /etc file).
>
> Any suggestion as to the preferred default TTL? 10 minutes?
>
Typical DNS TTL values are on the order of a day but it can vary widely.
There's really no correct answer for this, since you have no way to tell
how long the entry has been sitting in the DNS server's cache before you
queried for it.
So, you're probably down to just finding some value that doesn't hammer
the DNS server too much, but that allows you to get new entries in a
reasonable amount of time.
10 mins sounds like a reasonable default to me.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2020-04-14 20:16 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 14:20 David Howells
2020-04-14 20:16 ` Jeff Layton [this message]
2020-04-15 17:07 ` Steve French
2020-04-16 10:15 ` David Howells
2020-04-15 9:44 ` Florian Weimer
2020-04-16 10:27 ` David Howells
2020-04-16 10:33 ` Florian Weimer
2020-04-16 13:01 ` David Howells
2020-04-16 13:40 ` Chuck Lever
2020-04-17 11:31 ` Aurélien Aptel
2020-04-17 23:23 ` Steve French
2020-04-18 18:10 ` Florian Weimer
2020-04-19 4:53 ` Steve French
2020-04-19 8:37 ` David Howells
2020-04-20 0:58 ` Paulo Alcantara
2020-04-20 13:13 ` David Howells
2020-04-20 18:21 ` Paulo Alcantara
2020-04-20 22:14 ` cifs - Race between IP address change and sget()? David Howells
2020-04-20 22:30 ` Jeff Layton
2020-04-21 1:29 ` Ronnie Sahlberg
2020-04-21 2:26 ` Steve French
2020-04-21 2:29 ` Steve French
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e751977dac616d93806d98f4ad3ce144bb1eb244.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=fweimer@redhat.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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
all inboxes | Powered by JetHome®