Repository navigation
resolved: create private stub resolve file for integration with resolvconf - #7014
Conversation
|
Note this also has units for resolvconf integration, which may or may not be desired to be shipped in systemd. I think it would be best to ship those units upstream in resolvconf instead. But when this was written both systemd and resolvconf portions were Ubuntu distro patches. |
poettering
left a comment
There was a problem hiding this comment.
I like it!
Also, the section about /etc/resolv.conf in the systemd-resolved.service.8 needs a brief addition about this. It currently lists three modes of handling /etc/resolv.conf, and we should list the fourth one (this new one) there, too, and suggest that it is the best option.
There was a problem hiding this comment.
hmm, I think the old write_resolv_conf_contents() function should be renamed a bit to make clear what it actually contains now. Something like "write_uplink_resolv_conf_contents()" or so. That way we have the "stub" and the "uplink" version of resolv.conf, which I think should be pretty clear in their purposes
There was a problem hiding this comment.
i'd prefer if we wouldn't have this bit in systemd. It's a Debianism, and should really live downstream I think.
That said, I think for systems not using Debian's resolvconf tool, this new stub file should become the default. Can you update tmpfiles.d/etc.conf.m4 accordingly?
There was a problem hiding this comment.
resolvconf stuff is dropped. tmpfiles updated.
d7f297a to
01d6e9b
Compare
|
@poettering everything is updated, i guess this new re-review. Also I've now spotted nspawn integration, which imho looks obsolete and/or needs a switch to stub-resolv.conf? |
poettering
left a comment
There was a problem hiding this comment.
one trivial nitpick. lgtm otherwise
There was a problem hiding this comment.
typo: 127.0.053 → 127.0.0.53
yeah, we need to figure out something there. Currently nspawn's resolv.conf logic is fully static, and the status quo ante static resolv.conf file matches that nicely. Anything more dynamic becomes a lot more complex, as propagating changes from the host into the container is hard, as bind mounting a dynamic file from the host conflicts with the desired to do atomic updates on the file (as atomic file updates means create new and rename, which will break propagation of bind mounts on the old file). I figure we should just accept that DNS server info is propagated into container payloads by nspawn, but search domains are not, but need to happen locally. i.e. something akin to the status quo ante... |
01d6e9b to
d764d22
Compare
|
Typo fixed. I'm ok with containers not propagating dynamic search domains. So should the private resolv.conf & stub-resolv.conf be removed on the service shutdown? imho they should not be.... but i might be overlooking something in the resolved lifecycle here. Hence I have this hunk of code: |
|
Looks good! thanks! However, it's currently unmergable due to some other conflicting merge. Could you please rebase on current git and force push? thanks! |
…ration This creates a second private resolve.conf file which lists the stub resolver and the resolved acquired search domains. This runtime file should be used as a symlink target for /etc/resolv.conf such that non-nss based applications can resolve search domains. Fixes: systemd#7009
d764d22 to
624e303
Compare
|
sigh i wish github would ping me via notifications or email when that happens. @poettering Rebased & force pushed. |
|
excellent! thanks! |
| dynamic file. It points at the systemd-resolved stub DNS 127.0.0.53 | ||
| resolver and it includes dynamically acquired search domains. This | ||
| achieves a more correct DNS resolution by software that bypasses | ||
| local DNS APIs (e.g. NSS). |
There was a problem hiding this comment.
It is unclear what the last "e.g." refers to: is NSS an example of a software that bypasses local APIs or is it an example of those local APIs? (I know the answer, I'm just pointing out that this needs editing.)
Maybe also add a sentence like "See the section /ETC/RESOLVED.CONF in systemd-resolved.service(8) for more information.".
There was a problem hiding this comment.
I'm not a native english speaker, but I do not think anybody out of the target audience will be confused by this statement as is. And it appears to be grammatically correct to me.
|
Let's merge this for now, we can tweak the NEWS file when releasing |
This creates a second private resolve.conf file which lists the stub resolver
and the resolved acquired search domains.
This file is then supplied to resolvconf, such that non-nss using software does
name resolution via stub resolver, with search domains information.
This runtime file may be used as a symlink target for /etc/resolv.conf such
that non-nss based applications can resolve search domains. It is used by
default on Ubuntu 17.10+
Fixes: #7009