0

My system has this:

 $cat /etc/resolv.conf
 search myweb.com
 nameserver 171.70.168.183
 nameserver 2.2.2.2

But when I booted my system(actually in pristine condition) this search line with myweb.com wasn't present.

Did the DNS server add it?

And if it did add it then why didnt all the hosts connected to the same DNS get that search param? It happened only on a few.

1
  • What distribution do you use? Each has different config files to change the behaviour of automatic resolv.conf changes.
    – Nils
    Feb 11, 2012 at 22:23

2 Answers 2

0

it is usually the DHCP client that updates /etc/resolv.conf because the DHCP server can push some options such as the domain or the DNSs to the clients.

0

Search domains are typically added to resolve.conf when the system is installed or when dhcpcd receives DNS information while obtaining a DHCP lease.

2
  • I am getting an invalid search param that is getting added to the resolv.conf. How do I ignore it because now all my domain look-ups are getting suffixed with that string.
    – Bornfree
    Feb 9, 2012 at 11:35
  • You could try appending "-C resolv.conf" to the line in your init/rc file which starts the /sbin/dhcpcd. The init files are typically in /etc/init.d or /etc/rc.d. However note that you will need to manually set your DNS servers in your /etc/resolv.conf if you configure dhcpcd to not run the resolve.conf script. Alternatively, you could edit the dhcpcd script which modifies the resolve.conf (possibly located in /lib/dhcpcd/dhcpcd-hooks) to not add a search domain. Feb 9, 2012 at 11:47

You must log in to answer this question.

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