Steve Scrimpshire Posted June 5, 2006 Report Share Posted June 5, 2006 (edited) How do I keep the "search blahblah" line from showing up in /etc/resolv.conf? The only reference I can find for the host there is in the router itself. I have NEEDHOSTNAME=no set in /etc/sysconfig/network-scripts/ifcfg-wlan0 Edited June 5, 2006 by Steve Scrimpshire Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted June 5, 2006 Report Share Posted June 5, 2006 This is the only thing I can think of: [root@esprit ian]# cd /etc/sysconfig/network-scripts [root@esprit network-scripts]# cat network-functions | grep search # Set up a default search path. if ! grep search /etc/resolv.conf >/dev/null 2>&1; then echo "search $domain" >> $rsctmp Maybe commenting these out would stop the line appearing in /etc/resolv.conf, but purely a guess, it's all I can come up with. I use static ip, so I don't get this problem, but believe most likely common to DHCP type connections. Anyway, hope it helps some. Quote Link to comment Share on other sites More sharing options...
iphitus Posted June 5, 2006 Report Share Posted June 5, 2006 what's wrong with it being there, and what does it actually do? If your system is getting a different hostname from your connection, this isnt the cause. Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted June 6, 2006 Author Report Share Posted June 6, 2006 ian: I have already tried commenting that out. It still shows up. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted June 6, 2006 Report Share Posted June 6, 2006 what's wrong with it being there, and what does it actually do? If your system is getting a different hostname from your connection, this isnt the cause. As far as I know, the search line is supposed to search your domain name maybe to find a DNS server, or something like that, before it interrogates your DNS entries. I have it configured in mine, because I added it manually, and doesn't seem to cause me any performance issues. Seems to be the same with or without. Another entry configurable, is the same, except replace "search" with "domain". This is required, at least in Gentoo, to ensure the domain name is configured correctly. Steve, I'll see if I can find something else to stop it being entered. Quote Link to comment Share on other sites More sharing options...
Gowator Posted June 6, 2006 Report Share Posted June 6, 2006 I have to admit finding this a pain myself. In the end I just set the IP and gw manually and as I posted the following on the kanotix forum Ill just paste it... ..... However in /etc/dhcp3/dhclient.conf you can edit the request line to not ask or assign DNS server info request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name, and secondly under the lease directives is an option option domain-name-servers 127.0.0.1; where you can add your ISP's DNS server... I think you can find an option for the search domain too..but you will find it as well as me now you are looking inthe right place I hope... :D Quote Link to comment Share on other sites More sharing options...
Qchem Posted June 6, 2006 Report Share Posted June 6, 2006 If you're using ext2 or ext3 as your filesytem you could lock the file: chattr +i /etc/resolv.conf Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted June 7, 2006 Author Report Share Posted June 7, 2006 Ok, looks like I have it figured out. First, let me say that dhclient is run as a service with the directive that /etc/dhclient-wlan0.conf is the config file: send host-name "laptop.mdk"; # temporary ifup addition and I am too afraid to add directives to it...afraid to screw things up. I found this in /sbin/dhclient-script that I commented out and it seems to work: # if [ -n "$DOMAIN" ]; then # d="search $DOMAIN" # elif [ -n "$new_domain_name" ]; then # d="search $new_domain_name" # fi If this gives me trouble, I may do the chattr option or try m hand at adding some directives to /etc/dhclient-wlan0.conf. Thanks guys! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.