Repository navigation
Description
Is your feature request related to a problem? Please describe.
The context is related to two bug reports I did earlier - namely:
While I started fixing the man pages, I thought that maybe changing the current behavior - from - query any matching [sub]domains even if longer (more precise) are available - to - query the server(s) with the longest available route / search domain names only - would be better after all.
TBH I'm not sure if the current behavior is intended or actually subtly bugged - the comment in 9472 suggests the former, so I wrote this as a RFE.
A clear and concise description of what you want to happen.
Make the route and search domains work on basis of the longest search/route domain available (as e.g. unbound behaves). Consider following example:
global settings:
- routing domain: ~.
- dns server: 1.1.1.1
link1:
- routing/search domain: example.com
- dns server: 10.0.0.1
link2:
- routing/search domain: bar.example.com
- dns server: 192.168.0.1
Currently - if any of the more precise links are online and provide dns for the same name returning different addresses (e.g. company's internal addresses), then .~ will potentially cause issues - as any and all queries will also go to 1.1.1.1. The same applies to any other link if we add .~ there as well
Similarly, if say link1 and link2 are active, the query for foo.bar.example.com will go to dns servers of both connections (as both example.com and bar.example.com formally match foo.bar.example.com). If addresses replied by respective nameservers are different, then this will also not work correctly (on top of the query being sent to 1.1.1.1 as well, if ~. was still present in the configuration).
Normally, the users will always be interested in the queries being sent to the most specific name server(s) (longest route/domain search name that can match the query). And at the same time - they will not want them to go to more generic dns servers (the worst case scenario being ~. present on any of the links or globally), as in most cases it won't even make any sense.
From other resolvers supporting similar functionality - aforementioned unbound behaves this way.
Even if for some reason someone would want more generic servers answering queries when more precise servers are available - current behavior could be retained by simply specifying those search/route domains explicitly.
Describe alternatives you've considered
An alternative could be adding separate class of search/routing domains (e.g. with additional prefix: ~!. ~!example.com !example.com) that would behave in a way described above - but that feels like an overkill and the current behavior doesn't really offer any particular benefits.
Activity
poettering commentedon Dec 4, 2018
Fix waiting in #11050
msoltyspl commentedon Jan 10, 2019
I think there is still issue with this (as tested with systemd v240). I tested 4 (1 link + 3 macvlans) links with 4 search domains:
touk.pl
a.touk.pl
b.a.touk.pl
c.b.a.touk.pl
Then did simple:
for a in {0..99}; do resolvectl flush-caches; ping -c1 -w1 xx; doneThe effect was essentially random. First reply to get back to resolver won "the competition":
With typical log entry:
Adding ~. causes the same behavior as explained earlier - it routes the query to dnses on links where it's defined and nowhere else. If those links have search domains defined, then they will be appended and tried. In the example above, if we had:
a.touk.pl ~.
b.a.touk.pl ~.
Then the answers for
xxwould randomly become an address assigned toxx.a.touk.plorxx.b.a.touk.pl. (even if those two links hadDNSDefaultRoute=no, as ~. takes precedence over it).(for the record - querying for fqdn names that don't involve domain appending behaves correctly now, the above is only in context of names that must be appended first - the case above is kind of a corner one; none the less
~.probably shouldn't be interested in names without dots at least).msoltyspl commentedon Jun 18, 2019
Been going over my older still open issues.
I redid the tests related to the last reply with stable-v242 and I can't reproduce the
~.issues anymore. In context of single-name's completions the search domains are tested correctly against the names on links where they appear regardless if/where~.is or isn't.The random "win first" - not sure if it's worth pursuing - and there's also no clean solution if the domains are not related either way.
So I'll close this issue - should I find at some point something related/similar, I'll create a new one.