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.

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)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search aaaa.bbb.example.net
search something
nameserver 1.2.3.4
nameserver 1.2.3.5

I can't explain the search aaaa.bbb.example.net 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

3 Answers 3

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 aaaa.bbb.example.net 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

 
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.