Crie um arquivo /etc/dhcp/dhclient-enter-hooks
com o seguinte conteúdo:
#!/bin/sh
make_resolv_conf(){
:
}
Torne-o executável chmod +x /etc/dhcp/dhclient-enter-hooks
A explicação sobre o man dhclient-script
Hooks
When it starts, the client script first defines a shell function, make_resolv_conf
, which is later used to create the /etc/resolv.conf
file. To override the default behaviour, redefine this function in the enter hook script.
On after defining the make_resolv_conf
function, the client script checks for the presence of an executable /etc/dhcp/dhclient-enter-hooks
script, and if present, it invokes the script inline, using the Bourne shell '.' command. The entire environment documented under OPERATION is available to this script, which may modify the environment if needed to change the behaviour of the script.
Como: Certifique-se de que o /etc/resolv.conf nunca seja atualizado pelo cliente DHCP