Network-manager, dnsmasq and OpenNIC

Today, a quick how-to on how to:

  • Override nameservers provided by your DHCP server by the ones from https://www.opennicproject.org, when you are using network-manager
  • Use Network-Manager with dnsmasq to speed up DNS resolution

    I assume you are using your Linux machine as a desktop, not a server, and with network-manager.

    Always use OpenNIC name servers

    In /etc/dhcp/dhclient.conf, add this line, this will override DNS provided by your DHCP server:

    You can put several servers separated per commas.

    Restart network-manager, then you can check /etc/resolv.conf file has been written with the OpenNIC nameservers.

    You can find the closest name servers to your location here: http://wiki.opennicproject.org/ClosestT2Servers

    Use dnsmasq as local DNS cache

    Easy, install dnsmasq package, then put this in /etc/dnsmasq.d/custom:

    To inform network-manager than you want to use dnsmasq as local DNS resolver, add this line in the [main] section of /etc/NetworkManager/NetworkManager.conf file:

    You can now check than /etc/resolv.conf contain this:

    Enjoy !

    Useful links:

    https://wiki.archlinux.org/index.php/Dnsmasq
    ~

Tweet about this on TwitterShare on Google+0Share on Facebook0Email this to someone

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *