Dynamic IP troubles "Hostname and DNS Client -> DNS Client Options"

On a CentOS system, a dirty but workable kludge would be to make /etc/resolv.conf immutable while the file is in the desired state. I think (but am not sure) that it would work for Ubuntu, as well.

It’s certainly not the preferred way of doing things – disabling or reconfiguring whatever is hosing the configuration would be the right way – but it should work as a workaround while you’re figuring that out.

chattr +i /etc/resolv.conf

would prevent the file from being changed, even by root. If root ever needs to change it, then

chattr -i /etc/resolv.conf

would have to be run first.

Richard

1 Like