I use Ubuntu 12.04 on my work laptop. Currently I live abroad and I only have this one computer, and I take it home after work to use as my personal computer. The problem is that the nameserver used on the office network differs from the nameserver on my own network at home.
At the office I need to use 10.4.180.250, and at home I need to use 192.168.1.1.
My /etc/dhcp3/dhclient.conf has this line in it:
prepend domain-name-servers 192.168.1.1;
When I connect to the work network I need to manually change my resolv.conf and change the nameserver to 10.4.180.250. Then I connect to another office in another country with a VPN, and the resolv.conf gets reset and I need to change the nameserver back to 10.4.180.250 again.
Is it possible to always have both nameservers in my resolv.conf by using multiple prepends?
prepend domain-name-servers 192.168.1.1;
prepend domain-name-servers 10.4.180.250;
or:
prepend domain-name-servers 192.168.1.1 10.4.180.250;
Are there disadvantages to having a nameserver that is "invalid" for the current network? It there a better way to do it?
192.168.1.1at work , what you are doing is right – warl0ck Apr 25 '12 at 2:22