![]() Update the permissions on the nodnsupdate file. vim /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate This is the method that I recommend using the most.Įdit /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate. If you need to remove the write protect attribute, use the following command. The +i option (attribute) write protects the /etc/nf file on Linux so that no one can modify it - not even the root user. Once you have made your edits, write protect that file. Method 2: Write protect your nameserversĬhange your nameservers by editing /etc/nf. Remember, you must replace these values with the appropriate IP/netmask/gateway of server. Make the following edits: # Comment out this line Now that we have the IP/netmask/gateway, edit /etc/network/interfaces. In this example, I will use the gateway address 1.2.3.1. ifconfig | grep "inet addr" | head -n 1 | awk '' If you use this method, you may find that the reboot processing (until you can login through ssh) takes longer.įirst, we need to get the IP/netmask/gateway of the server. On a cloud vps, I do not suggest using this method. Method 1: Change interface settings to static This tutorial shows three methods to stop DHCP from changing the /etc/nf on Debian or Ubuntu. Then, after a period of time (or after a system reboot), you discover that your changes to /etc/nf have been reverted. For DHCP users, there may be times when you need to edit /etc/nf to use other nameservers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
May 2023
Categories |