Using DNS Servers in Debian/Jessie

Say you want to use DNS servers 1.2.3.4 and 1.2.3.5.

In /etc/resolve.conf, have the following line:

nameserver 1.2.3.4
nameserver 1.2.3.5

and make sure there are no dns-nameservers lines in /etc/network/interfaces.

In /etc/dhcp/dhclient.conf, have the following line:

supersede domain-name-servers 1.2.3.4, 1.2.3.5;

Restart the networking service:

$ sudo /etc/init.d/networking restart

Check if the DNS server is used:

$ dig somehost.com
...
;; SERVER: (should see the DNS server here)
...
This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Using DNS Servers in Debian/Jessie

  1. c says:

    this does not apply to the latest copies of jessie.
    resolveconf.conf comes into play.

    • Taro says:

      c — That could be true, as I have seen /etc/resolv.conf sometimes getting overwritten by some process.

      But on my Jessie box it still works with the config that I outlined in this point. Will see.

Leave a Reply

Your email address will not be published. Required fields are marked *