1

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?

3 Answers 3

2

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.

1
  • 8 years later, still the only answer that works! Ubuntu 18.04 LOL
    – niCk cAMel
    Feb 5, 2020 at 20:03
2

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.

0

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.

3
  • On my 12.04 installation, /etc/resolv.conf is a symlink pointing to /run/resolvconf/resolv.conf May 11, 2012 at 10:39
  • Interesting... I don't have this file /run/resolvconf/resolv.conf
    – Corey
    May 18, 2012 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. Jul 22, 2012 at 1:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .