Looking at This Post on Multiple Networks, I was wondering how to include the ability to change the dns nameservers. At home I would use one set of information but at school I need to use a different set.
2 Answers
If you use dhcp
(most networks support this) it will be configured automatically. Raspbian is setup to use dhcp
(or dhcpd
in later Raspbian) by default.
The post you referenced tries to manually configure things; it may work if you know what you are doing, but is not necessary.
-
I do need to use static IP addresses on both networks, so no DHCP options. Commented Aug 17, 2015 at 19:58
As Milliways points out, on normal DHCP equipped networks there's no need to do this.
However, if you still want to, your nameservers are listed in /etc/resolv.conf
. Beware that when you do connect as a DHCP client, this will get overwritten, so if you want to have several versions, name them something else and copy them in when you want to use them. The effect is immediate, there is no need to reboot or restart anything.
-
Sooo. No way to automatically do this? I mean, short of writing a script to switch resolv.conf files based on which SSID I am using? Commented Aug 17, 2015 at 20:01