systemd icon indicating copy to clipboard operation
systemd copied to clipboard

RFE: Add `systemd.dns-search-domains=` kernel cmdline argument

Open LorbusChris opened this issue 3 years ago • 3 comments

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

LorbusChris avatar Jul 25 '22 06:07 LorbusChris

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.

poettering avatar Jul 25 '22 07:07 poettering

Would it make sense to add the DNS search domains as a credential?

pyfisch avatar Aug 07 '22 06:08 pyfisch

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.

poettering avatar Aug 08 '22 08:08 poettering

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?

pemensik avatar Oct 20 '22 16:10 pemensik

see my earlier comment, we should probably just implement what suse already does, i.e. honour "nameserver="

poettering avatar Oct 21 '22 11:10 poettering