Here is a complete solution that works at least with 12.04
:
sudo nano /etc/dhcp/dhclient.conf
# add next line (alternatively you can use append instead of prepend)
prepend domain-name "example.com other.example.com";
# before: request subnet-mask...
(you can also use sudo -e /etc/dhcp/dhclient.conf
if you trust the default editor)
If you're on any sort of "professional" network that has its own DNS servers and/or if you've setup your own DNS service(s) on said network and also on your workstation, then, you might also want to comment-out this line:
# domain-name, domain-name-servers, domain-search, host-name,
--Doing so lets you use your own domain-name-servers, enabling your personalized domain-search to work much more smoothly, which is probably better than using whatever somebody else has setup for you. E.G.: I'm on the network 192.168.10.0; the company has name server 192.168.10.10 and 192.168.10.11 -- but, I run my own name server with a more extensive list of names on 192.168.10.20 (which will forward to 192.168.10.10 and .11 as needed). All my network configurations declare 192.168.10.20 and 8.8.8.8 and 8.8.4.4 (the Google name servers), but, DHCP will tend to override that preference, feeding me 192.168.10.10 as the default server. In the end... not requesting those aspects from DHCP makes for a much better network life.
Now restart the networking:
sudo service networking restart
(you can also use sudo /etc/init.d/networking restart
with old rc scripts)
Best Answer
In Ubuntu GNOME 16.04, you are correct that the ability to edit or add additional search domains is unavailable, but this is only true for the 'default' network editing system that you see. This 'newer' one was put in place, according to Jeremy Bicha in the
#ubuntu-gnome
IRC chat channel on Freenode, because the default editor in Settings should be easier to use for most end-users:And of course you can't see search domains in the default editor:
However, the original network editing GUI is still available. Just run
nm-connection-editor
. This will launch the same, good-old Network Manager editing window that you expect to see. That has the ability to do search domains. (Thanks to the#ubuntu-gnome
IRC channel on Freenode for this!)This procedure/answer also works in 18.04 and 20.04 as well (tested myself).