Re: Question about the behavior of systemd (when requesting A/AAAA via multiple interfaces)

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

 



On Mo, 01.07.24 12:56, 松藤 諒太 (r-matsufuji@xxxxxxxxxxxxxxxxxxxxxxxx) wrote:

Hi!

> At this condition, I've found that systemd-resolved performed to return the
> result of those queries to application
> unless all queries are completed being resolved via one of multiple
> interfaces.

we have two rules when looking things up:

1. don't mix & match replies from different sources (i.e. we will not
   return a reply that combines an A reply from netif 1 and an AAAA
   reply from netif 2)

2. first positive reply wins, last negative reply wins (i.e. if we
   submit queries on multiple interfaces in parallel and we only see
   negative replies we'll wait until the very last query is complete
   before we report this back to the client. if however we get a
   positive reply any time, we immediately return that.)

When a local app issues a lookup request with unspecified address
family, we'll fire off a pair of lookups (i.e. A + AAAA) on each
interface that matches the domain name routing rules, and wait for
both of these to finish, then combine the results of both (this
follows rule 1 above, as both replies come from the same iface in this
case), and then find the right of these combined replies to propagate
to teh app, according to rule 2 above.

> If is there any reason or restriction that resolved should wait for
> completing all queries through one of interfaces to return the result,
> I'm afraid I would ask the question for why it is ?

Well, apps might implement rules on whether they prefer ipv4 or ipv6
if both are available, hence we need to hand them both sets of
addresses so that they can make their choice.

i.e. we generally want to reply with "complete" responses, i.e. that
carry all information that can be acquired from a specific DNS
server that gives us information about the query. But if there are multiple
DNS servers that give us info, then we make a choice and only return
one reply.

> Furthermore, does systemd provide the configuration to switch this behavior
> ?

There's is no configuration option to control this behaviour.

Lennart

--
Lennart Poettering, Berlin



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux