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.


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.

| improve this answer | |
  • I do need to use static IP addresses on both networks, so no DHCP options. – JCT Aug 17 '15 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.

| improve this answer | |
  • 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? – JCT Aug 17 '15 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.