View Issue Details

IDProjectCategoryView StatusLast Update
0018202CentOS-7dhcppublic2021-05-21 02:06
Reporterpuravidacentos Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformAmazon Web ServiceOSCentOSOS Version7
Summary0018202: append domain-search "abc.com" dhclient.conf works as prepend
DescriptionSpecify

prepend domain-search "abc.com";

in /etc/dhcp/dhclient.conf but the domain ended prepended instead appended.
Steps To Reproduce[1] create /etc/dhcp/dhclient.conf
# more /etc/dhcp/dhclient.conf
interface "eth0" {
  prepend domain-search "abc.com";
}

[2] ps -eaf | grep dhclient
root 4366 1 0 19:13 ? 00:00:00 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient--eth0.lease -pf /var/run/dhclient-eth0.pid -H ip-172-31-3-61 eth0

[3] kill pid in step [2]
[4] rerun command in step [2]
[5] # cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
search abc.com. us-west-1.compute.internal
nameserver 172.31.0.2
TagsNo tags attached.
abrt_hash
URL

Activities

ManuelWolfshant

ManuelWolfshant

2021-05-20 23:54

manager   ~0038450

I am not sure that I get it. Per your reproducer you explicitly specify _prepend_ in the config file and then complain that the domain gets _prepended_ ?
puravidacentos

puravidacentos

2021-05-21 01:05

reporter   ~0038451

_prepend domain-search "abc.com"_ in the step 1 in reproducer should be _append domain-search "abc.com"_.
ManuelWolfshant

ManuelWolfshant

2021-05-21 02:06

manager   ~0038452

I cannot reproduce your exact issue but there indeed seems to exist a problem with dhclient. On my system (which is a fully updated 7.9) if I use any of the prepend or append options, the search domain sent by the DHCP server is ignored and replaced by the values provided by prepend and append from dhclient's config file, postfixed with a dot ( "abc.com." for instance )
my test was performed by creating the adequate dhclient.conf file and then issuing
           ifdown enp2s0; rm /etc/resolv.conf; ifup enp2s0; cat /etc/resolv.conf
Unless someone chimes in with a correction or better idea, I suggest to file a bug at bugzilla.redhat.com and hope for the best ( RHEL 7 is in maintenance mode so RH no longer provides anything but fixes they consider to be of high importance, mostly high-impact security fixes ). CentOS is built from the sources provided by RH so if they provide a fix, CentOS will inherit it automatically.

Issue History

Date Modified Username Field Change
2021-05-20 20:01 puravidacentos New Issue
2021-05-20 23:54 ManuelWolfshant Note Added: 0038450
2021-05-21 01:05 puravidacentos Note Added: 0038451
2021-05-21 02:06 ManuelWolfshant Note Added: 0038452