Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
What distribution do you use? Each has different config files to change the behaviour of automatic resolv.conf changes. –  Nils Feb 11 '12 at 22:23
add comment

migrated from stackoverflow.com Feb 10 '12 at 16:32

This question came from our site for professional and enthusiast programmers.

2 Answers

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.

share|improve this answer
add comment

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

share|improve this answer
    
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 '12 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. –  David M. Syzdek Feb 9 '12 at 11:47
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.