Set DNS Servers For All Wifi Networks

Tom H tomh0665 at gmail.com
Thu Sep 11 08:38:39 UTC 2014


On Wed, Sep 10, 2014 at 3:42 PM, Sajan Parikh <sajan at parikh.io> wrote:
>
> Right now, I can go into the connection manager, choose a wireless network
> and update the DNS servers to use by setting the IPv4 to Automatic DHCP,
> address only.  However, when I connect to another network, the default is to
> pull an IP address from the DHCP along with the DNS servers.
>
> Is there a way for me to default all new connections to DHCP Address Only,
> and set some sort of permanent DNS servers?  I thought about throwing them
> into /etc/resolv.conf, but I assume that gets overwritten everytime I switch
> connections.

If you haven't uninstalled "resolvconf", add the DNS server to
"/etc/resolvconf/resolvconf.d/head".

Otherwise set "supersede domain-name-servers dns_server_ip_address;"
in "/etc/dhcp/dhclient.conf" (and/or - no longer sure but necessary
for NM AFAIR - "/etc/dhcp/dhclient-nic_name.conf").




More information about the ubuntu-users mailing list