Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using 12.04 and have a problem with my resolv.conf

There are 2 search lines there. But I can only explain one. I would like to get the other one removed.

carsten@myubuntubox:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
search something

I can't explain the search Where does it come from?

The last 3 lines (like I want come from /etc/resolvconf/resolv.conf.d/tail This is good.

But where is the other search line coming from? In /etc/dhcp/dhclient I removed the requests for domain-name-servers, domain-search, but the lines are still in there.

Should I remove the dhcp6.domain-search as well?

share|improve this question

The reason you have two search lines is that one (the first one) is generated by resolvconf dynamically, based on its own configuration and on nameserver information supplied to it by interface configurers; and the other (the second one) is appended verbatim from /etc/resolvconf/resolv.conf.d/tail. Only the last one is used by the resolver. Hence, the first one is inoperative.

share|improve this answer

Add the line

supersede domain-search "something";

to the end of /etc/dhcp/dhclient.conf. Perhaps your comes from your (ISP's) DHCP server?

Or if you want something like

search some.thing something.else

in your resolv.conf, add a line like

supersede domain-search "some.thing", "something.else";

in your /etc/dhcp/dhclient.conf.

share|improve this answer

This isn't exactly what you were looking for... but here you go anwyay

You can delete the /etc/resolv.conf symlink and create a normal file with the contents you want.

On that note, I've accidentally done that somehow and was wondering if you could tell me what your /etc/resolv.conf symlink is pointing to so I can fix mine.

share|improve this answer
On my 12.04 installation, /etc/resolv.conf is a symlink pointing to /run/resolvconf/resolv.conf – Clive van Hilten May 11 '12 at 10:39
Interesting... I don't have this file /run/resolvconf/resolv.conf – Corey May 18 '12 at 19:38
@Corey: You can try dpkg-reconfigure resolvconf - in my case it recreated /run/resolvconf/resolv.conf and symlinked /etc/resolv.conf to it. – Tomasz Zieliński Jul 22 '12 at 1:35

Your Answer


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.