Ubuntu – How to set the dns search domain in Ubuntu 12.04

networkingUbuntuubuntu-12.04

/etc/resolv.conf is dynamically generated from the contents of /etc/network/interfaces, which on my system contains a line like this:

dns-servers 8.8.8.8

How do I include the default search domain with this configuration? If it matters, I'm running a pure Ubuntu Server configuration, with no X server installed.

Best Answer

Since you seem to be using resolvconf, you will want to use the dns-search option within your network interfaces file

#/etc/network/interfaces 
# The primary network interface
auto eth0
iface eth0 inet static
    address 10.2.37.4
    netmask 255.255.254.0
    gateway 10.2.37.1
    dns-nameservers 10.2.51.4 10.2.52.4
    dns-search example.org