mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Would love to see reconsideration for domain and search DNS keywords
Date: Fri, 4 Sep 2015 14:04:29 -0400	[thread overview]
Message-ID: <20150904180429.GT17773@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAGF8=Fy+w40N649SOud-U7c-hRLznmyrMrefUcs7Z6zuVy9WRw@mail.gmail.com>

On Fri, Sep 04, 2015 at 12:11:36PM -0500, Andy Shinn wrote:
> I'm writing the wonderful musl project today to open discussion about the
> future possibility of DNS search and domain keyword support. We've been
> using musl libc (by way of Alpine Linux) for new development of
> applications as containers that discover each other through DNS and other
> software defined networking.
> 
> In particular, we are starting to use applications like SkyDNS, Consul, and
> Kubernetes, all of which rely on local name resolution in some way using
> search paths. Many users of the Alpine Linux container image have also
> expressed their desire for this feature at
> https://github.com/gliderlabs/docker-alpine/issues/8.
> 
> On the functional differences between glibc page, the domain and search
> keyword "Support may be added in the future if there is demand". So please
> consider this request an addition to whatever demand for the feature
> already exists.
> 
> Thank you for your time and great work on the musl libc project!

I think this is a reasonable request. I'll look into it more.

One property I do not want to break is deterministic results, so when
a search is performed, if any step of the search ends with an error
rather than a positive or negative result, the whole lookup needs to
stop and report the error rather than falling back. Falling back is
not safe and creates a situation where DoS can be used to control
which results are returned.

While it would be possible to parallelize the search while serializing
the results (i.e. waiting to accept a result from the second query
until the first query finished with a negative result), I think the
consensus during the last round of discussion of this topic was that
the complexity cost is too great and the benefit too small. Ideally,
the first query should always succeed, anyway.

I also have a few questions:

1. Do you need multiple search items, or just a single domain? Any
   setup with multiple searches necessarily has suboptimal performance
   because ndots is not sufficient to make the right initial choice of
   query. If you do need this functionality, a unioning proxy dns
   server may be a better option than resolv.conf domain search; it
   would give much better performance.

2. For your intended applications, is there a need to support ndots>1?
   Such configurations are generally not friendly to applications that
   expect to be able to resolve normal internet domain lookups, and
   performance for such lookups will be very bad (because the search
   domains first have to fail).

3. The glibc behavior is just to swap the order of search when the
   query string has >=ndots dots in it, but would it be acceptable
   never to try the search domains at all in this case? That would
   yield much better performance for nxdomain results and avoid
   unexpected positive results due to weird subdomains existing in
   your search domain (e.g. a wildcard for *.us.example.com would
   cause *.us to wrongly resolve for non-existant .us domains).

Rich


      parent reply	other threads:[~2015-09-04 18:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04 17:11 Andy Shinn
2015-09-04 17:56 ` Szabolcs Nagy
2015-09-04 18:04 ` Rich Felker [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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150904180429.GT17773@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).