Set DNS Servers For All Wifi Networks
Karl Auer
kauer at biplane.com.au
Wed Sep 10 22:51:05 UTC 2014
On Wed, 2014-09-10 at 14:42 -0500, Sajan Parikh wrote:
> 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.
It's a while since I looked at this, but IIRC if you are using Network
manager /etc/resolv.conf is actually a link
to /etc/run/resolvconf/resolv.conf, a version of resolv.conf that is
managed by Network manager. If you break that link, by deleting and
recreating /etc/resolv.conf, then your changes to/etc/resolv.conf should
"stick". If you do this, I suggest writing a script that makes or breaks
the link, so that you can easily go back to the normal defaults if you
wish.
Alternatively, look at /etc/NetworkManager/dispatcher.d. There are
scripts in there that are run in response to various events, and you can
add your own. Read "man NetworkManager" for more information.
If your resolv.conf contains 127.0.0.1, then you are running dnsmasq (a
little local nameserver) and life may be a little more complex. See the
"NOTES" section in "man dnsmasq".
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389
GPG fingerprint: EC67 61E2 C2F6 EB55 884B E129 072B 0AF0 72AA 9882
Old fingerprint: B862 FB15 FE96 4961 BC62 1A40 6239 1208 9865 5F9A
More information about the ubuntu-users
mailing list