Ubuntu eks AMI's resolv.conf puts 032 instead of space when multiple search domains are configured in amazon dhcp options

Bug #1791578 reported by Suren Nihalani on 2018-09-10
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
cloud-images
Undecided
Unassigned

Bug Description

VPC's dhcp options set to multiple domains and then start a cluster with EKS AMI.

cat /etc/resolv.conf

```
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 10.0.50.4
nameserver 10.0.50.5
nameserver 10.0.50.6
search domain1.net032ec2.internal032domain2.net
```

tags: added: id-5b9697c30ea1905ec9ec5634
Cody Shepherd (codyshepherd) wrote :

Reproduced with 18.04 standard AMI; confirmed bug not present in 16.04.
This file is written out by systemd-resolved, which was introduced between 16.04 and 18.04, which explains the change in behavior.

Here's the same issue being reported on CoreOS as well:
https://github.com/coreos/bugs/issues/1934

We are doing more research to see if there's a path forward to support this behavior, though there is some disagreement on what the correct behavior is here based on the DHCP spec.

We will continue to investigate and provide updates on this bug.

Suren Nihalani (snihalani4) wrote :

Cool. Thank you @codeshepherd.

For other people who come across this, in the meantime (while the bug stays open), I ended up writing my own dhclient hook to manage resolv.conf myself

Cody Shepherd (codyshepherd) wrote :

As an update, we've determined this is a bug with Amazon's DHCP implementation. We have filed a bug with them and will update this bug once the issue is resolved.

Suren Nihalani (snihalani4) wrote :

Is there a public link where this is being discussed?

Changed in cloud-images:
status: New → In Progress
GGrandes (ggrandes) wrote :

My workaround solution (could be better):

# Enable dhclient-script
FILE="/etc/dhcp/dhclient.conf"
dpkg-divert --package "isc-dhcp-client" \
  --add "$FILE"
sed -i -e 's|#script.*|script "/sbin/dhclient-script";|g' $FILE

# Disabled resolved hook
FILE="/etc/dhcp/dhclient-enter-hooks.d/resolved"
dpkg-divert --package "isc-dhcp-client" \
  --add "$FILE"
mv $FILE $FILE.distrib
touch $FILE
chattr +i $FILE

# Rewrite parameters
cat >> /etc/dhcp/dhclient-enter-hooks.d/aaaa <<"END"
#!/bin/sh
export new_domain_search="$new_domain_name $new_domain_search"
export new_domain_name=
END
cat >> /etc/dhcp/dhclient-exit-hooks.d/aaaa <<"END"
#!/bin/sh
export new_domain_search="$new_domain_name $new_domain_search"
export new_domain_name=
END

Is the AWS bug resolved? or is there any other update?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.