RFE: Add `systemd.dns-search-domains=` kernel cmdline argument
Component
systemd-resolved
Is your feature request related to a problem? Please describe
https://bugzilla.redhat.com/show_bug.cgi?id=1874419
The related problem was also described in https://github.com/systemd/systemd/pull/22868
tl;dr it would be handy if one could explicitly specify DNS search domains on the kernel cmdline, so the system comes up with correct configuration right away.
Describe the solution you'd like
The systemd.dns-search-domains= kernel cmdline argument can be used to set DNS search domains.
Describe alternatives you've considered
https://github.com/systemd/systemd/pull/22868
The systemd version you checked that didn't have the feature you are asking for
251
That definitely makes sense to add.
Doing some research the iscsi stack supports nameserver= on the kernel cmdline, and the ip= switch also allows DNS config already (the latter which networkd even honours via the network-generator service). suse also honours nameserver= (see https://documentation.suse.com/sles/15-SP1/html/SLES-all/cha-boot-parameters.html#sec-boot-parameters-list-network)
So it appears to me, we should simply honour nameserver= too.
Would it make sense to add the DNS search domains as a credential?
sure. resolved should probably allow setting DNS server info, seach domains and /etc/hosts entries, all via credentials. There's an entry in the TODO file for that already.
Could be the kernel variable name made more general? The configuration variable name is not systemd specific, but DNS configuration specific. Other /etc/resolv.conf managers might also want to read such parameters. Would it make more sense to call it just dns.search-domains= and document in systemd it is able to read and use it?
see my earlier comment, we should probably just implement what suse already does, i.e. honour "nameserver="