Overwriting resolv.conf fails when resolv.conf is a bind mount with dhclient.
- ISC DHCP version: 4.4.2
- Tested OS: Arch Linux, Fedora
resolv.conf become a bind mount typically inside a network namespace, if a file
/etc/netns/<namespace>/resolv.conf is present. Running dhclient inside the namespace, it will fail to overwrite
resolv.conf, with error
mv: cannot move '/etc/resolv.conf.dhclient-new' to '/etc/resolv.conf': Device or resource busy.
Simple fix: Use
cat $new_resolv_conf > /etc/resolv.conf instead of using