Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of domain_name_servers and domain_name options matter #184

Closed
milan-zededa opened this issue Feb 6, 2023 · 1 comment
Closed

Order of domain_name_servers and domain_name options matter #184

milan-zededa opened this issue Feb 6, 2023 · 1 comment
Labels

Comments

@milan-zededa
Copy link

I don't know if this is an intended behaviour or a bug, but the order of domain_name and domain_name_servers options for static configuration matters. In fact, domain name should be configured first, otherwise the list of DNS servers is not applied (or maybe gets reset?).

$ dhcpcd --version
dhcpcd 9.4.1
Copyright (c) 2006-2021 Roy Marples
Compiled in features: INET ARP ARPing IPv4LL INET6 DHCPv6 AUTH PRIVSEP

With domain name preceding DNS servers, it works as expected:

$ dhcpcd -d --static ip_address=192.168.1.20/24  -b -t 0 --static "domain_name=mydomain" --static "domain_name_servers=192.168.10.10 192.168.11.11" eth0
no such user dhcpcd
dhcpcd-9.4.1 starting
spawned manager process on PID 7406
DUID 00:01:00:01:2b:73:88:e1:02:fe:22:1a:87:00
forked to background, child pid 7406

$ dhcpcd -U -4 eth0
no such user dhcpcd
reason=STATIC
interface=eth0
protocol=dhcp
ip_address=192.168.1.20
subnet_cidr=24
broadcast_address=192.168.1.255
network_number=192.168.1.0
subnet_mask=255.255.255.0
domain_name=mydomain
domain_name_servers=192.168.10.10 192.168.11.11

However, if domain_name_servers are specified first, they will be ignored:

$ dhcpcd -d --static ip_address=192.168.1.20/24  -b -t 0 --static "domain_name_servers=192.168.10.10 192.168.11.11" --static "domain_name=mydomain" eth0
no such user dhcpcd
dhcpcd-9.4.1 starting
spawned manager process on PID 7297
DUID 00:01:00:01:2b:73:88:e1:02:fe:22:1a:87:00
forked to background, child pid 7297

$ dhcpcd -U -4 eth0
no such user dhcpcd
reason=STATIC
interface=eth0
protocol=dhcp
ip_address=192.168.1.20
subnet_cidr=24
broadcast_address=192.168.1.255
network_number=192.168.1.0
subnet_mask=255.255.255.0
domain_name=mydomain

Although I haven't tested dhcpcd with a configuration file, it seems that the same issue is also reproducible if config file is used instead of command line arguments, as reported in this comment.

milan-zededa added a commit to milan-zededa/eve that referenced this issue Feb 6, 2023
For some strange reason the order of dhcpcd arguments
"domain_name_servers" and "domain_name" matters. In fact, domain name
should be configured first, otherwise the list of DNS servers is not
applied (or maybe gets reset?). I couldn't find the root cause for this
odd behaviour in the dhcpcd source code or any explanation in the
documentation. I decided to at least report the issue:
NetworkConfiguration/dhcpcd#184

Signed-off-by: Milan Lenco <milan@zededa.com>
eriknordmark pushed a commit to lf-edge/eve that referenced this issue Feb 7, 2023
For some strange reason the order of dhcpcd arguments
"domain_name_servers" and "domain_name" matters. In fact, domain name
should be configured first, otherwise the list of DNS servers is not
applied (or maybe gets reset?). I couldn't find the root cause for this
odd behaviour in the dhcpcd source code or any explanation in the
documentation. I decided to at least report the issue:
NetworkConfiguration/dhcpcd#184

Signed-off-by: Milan Lenco <milan@zededa.com>
@rsmarples rsmarples added the bug label Feb 7, 2023
rsmarples added a commit that referenced this issue Feb 7, 2023
So that domain_name doesn't overwrite domain_name_servers.
Fixes #184.
rsmarples added a commit that referenced this issue Feb 7, 2023
rsmarples added a commit that referenced this issue Feb 7, 2023
@milan-zededa
Copy link
Author

Thank you @rsmarples for fixing this so quickly!

jsfakian pushed a commit to jsfakian/eve that referenced this issue Feb 9, 2023
For some strange reason the order of dhcpcd arguments
"domain_name_servers" and "domain_name" matters. In fact, domain name
should be configured first, otherwise the list of DNS servers is not
applied (or maybe gets reset?). I couldn't find the root cause for this
odd behaviour in the dhcpcd source code or any explanation in the
documentation. I decided to at least report the issue:
NetworkConfiguration/dhcpcd#184

Signed-off-by: Milan Lenco <milan@zededa.com>
rouming pushed a commit to rouming/eve that referenced this issue Feb 13, 2023
For some strange reason the order of dhcpcd arguments
"domain_name_servers" and "domain_name" matters. In fact, domain name
should be configured first, otherwise the list of DNS servers is not
applied (or maybe gets reset?). I couldn't find the root cause for this
odd behaviour in the dhcpcd source code or any explanation in the
documentation. I decided to at least report the issue:
NetworkConfiguration/dhcpcd#184

Signed-off-by: Milan Lenco <milan@zededa.com>
eriknordmark pushed a commit to lf-edge/eve that referenced this issue Feb 13, 2023
For some strange reason the order of dhcpcd arguments
"domain_name_servers" and "domain_name" matters. In fact, domain name
should be configured first, otherwise the list of DNS servers is not
applied (or maybe gets reset?). I couldn't find the root cause for this
odd behaviour in the dhcpcd source code or any explanation in the
documentation. I decided to at least report the issue:
NetworkConfiguration/dhcpcd#184

Signed-off-by: Milan Lenco <milan@zededa.com>
shjala pushed a commit to shjala/eve that referenced this issue Feb 15, 2023
For some strange reason the order of dhcpcd arguments
"domain_name_servers" and "domain_name" matters. In fact, domain name
should be configured first, otherwise the list of DNS servers is not
applied (or maybe gets reset?). I couldn't find the root cause for this
odd behaviour in the dhcpcd source code or any explanation in the
documentation. I decided to at least report the issue:
NetworkConfiguration/dhcpcd#184

Signed-off-by: Milan Lenco <milan@zededa.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants