How to Permanently Configure DNS Server List in Ubuntu 16.04

networking

I've tried using network-admin. It has a list of DNS servers, including 127.0.0.1 and two that I put in. It always uses the 127 address first, no matter how many times I change it. The lists of files, hook scripts, etc, are confusing: where is the single configuration file for networking that I can modify to effect a permanent change?

I'm tired of asking my ISP's poor quality DNS server to serve my internet requests. I have no idea why Ubuntu repeatedly resets my configuration, or where the graphical interface stores this information — until it's changed again. This is UNNECESSARILY confusing.

I checked network-admin gui an hour ago and it read, in order, 127.0.1.1 8.8.4.4 8.8.8.8 I moved the two 8.'s to the top, above 127; just checked it, now the first, which wasn't on the list before, is 192.168.1.254 — which is my network routers lan-side address. Requests to this are routed to the internet; DNS requests here are automatically routed to att's DNS instead of Google's. This is demonstrated when there is a lookup error in FireFox browser it shows an error page from dnserrorassist.att.net

I really would like to have a single, static list of DNS servers, to be able to modify it at my will, and to set the lookup order in which they are used. Can i do that with Ubuntu (16.04)?

Best Answer

The correct answer for this question is:

  1. Go to the Network icon in the top panel.

  2. Select Edit Connections.

  3. Open the connection that you wish to modify, e. g. Wired Connection.

  4. Select the IPv4 tab.

    1. Set the Method to Automatic (DHCP) addresses only.

    2. In the DNS Servers field, enter a comma-separated list of your DNS servers.

    3. Depending on your version of Ubuntu, if you see a switch called Automatic, switch it to OFF.

    4. Click the Save button.

Do not edit your resolv.conf file!