• Resolv.conf - Preserving Search Names Upon Reboot


    Hello,

    As the subject states, I’m adding some additional search names to my /etc/resolv.conf file so I don’t have to type out the fully qualified domain name when I want to SSH to a server.

    I made these changes to the resolv.conf file and everything works as expected. However, when I restart my machine, the file gets reset and my changes are gone.

    How do I preserve the changes I make to the resolv.conf file? OR should I be making these changes in a different file?

    Thanks in advance for everyone’s time and help, it is greatly appreciated!

  • Anyone that can help please?

  • @a4orce84

    Hi

    Preserve DNS settings

    dhcpcd, netctl, NetworkManager, and various other processes can overwrite /etc/resolv.conf. This is usually desirable behavior, but sometimes DNS settings need to be set manually (e.g. when using a static IP address). There are several ways to accomplish this.

    If you are using dhcpcd, see #Modify the dhcpcd config below.
    If you are using netctl and static IP address assignment, do not use the DNS* options in your profile, otherwise resolvconf is called and /etc/resolv.conf overwritten.
    

    With NetworkManager

    To stop NetworkManager from modifying /etc/resolv.conf, edit /etc/NetworkManager/NetworkManager.conf and add the following in the [main] section:

    dns=none

    /etc/resolv.conf might be a broken symlink that you will need to remove after doing that. Then, just create a new /etc/resolv.conf file.

    Source: Arch wiki

    Regards

  • @a4orce84
    You may wanna try this solution, it works for me:
    /etc/resolv.conf is not saving after server reboot

  • I rather not make it only read-access, since a lot of other applications need to modify that file (Network Manager, vpnc, etc.).

    Anyone else have any other solutions or suggestions? I just want to add a few additional DNS entrees, nothing super crazy.

    Thanks,
    Asif

names1 search7 resolv.conf2 preserving2 Posts 5Views 349
Log in to reply