AKZN Notes

Archives for My Lazy and Forgetful Mind

Configuring DNS in Linux with resolv.conf

In Linux, you can configure DNS settings using the resolv.conf file. Here's a quick guide to get you started:

  1. Open a terminal.

  2. Edit the resolv.conf file using a text editor:

    sudo nano /etc/resolv.conf
  3. Add your preferred DNS servers:

    nameserver 8.8.8.8
    nameserver 8.8.4.4
  4. Save the changes and close the text editor.

  5. To prevent overwriting, create a symbolic link:

    sudo ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf
  6. Restart networking to apply the changes:

    sudo service networking restart

That's it! Your Linux system will now use the specified DNS servers. Remember, manual changes to resolv.conf might be temporary, depending on your network management tools.

Leave a Reply

Your email address will not be published.