Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Please provide:

  • correct location to add my custom domain search option (preferably appending it to the DHCP list, instead of prepending)
  • command to run to make the settings effective

Note: do not ask me to modify files that are auto-regenerated and overridden, like /etc/resolv.conf

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

You will need to edit this file with your favorite editor:

sudo vim /etc/dhcp/dhclient.conf

Once in file, you should see a commented line with the word supersede next to it:

#supersede domain-name "...."

Uncomment that line, substitute the name supersede for append, then add the domain names you wish to search (follow the example below and leave a space after the first "):

append domain-name " ubuntu.com ubuntu.net test.ubunut.com";

Save the file and close.

All you need to do is restart your network connection. You can do this by unplugging and plugging in the physical network connect OR disable and enable your network connect (see picture below). After that you should be good to go:

To verify:

sudo cat /etc/resolv.conf

Disconnect Network

enter image description here

Connect Network

enter image description here

share|improve this answer
    
Nice, but is the space before the first domain name necessary? –  l0b0 Mar 26 '13 at 8:27
    
@l0b0: Yes, you better have that space, otherwise the last existing domain-name (in resolv.conf) and the first newly added domain will stick together is like: existing-one.comfirst-append.com instead of having existing-one.com first-append.com. Cheers!! –  MacUsers Jun 10 '13 at 14:19
add comment

You can use the

→ nm-applet (right click) → Edit Connections → Choose connection → Edit → IPv4 Settings → Additional Search Domains

and enter your search domains there. After that, disconnect, connect and they'll be there.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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