Jump to content

How do I stop the "search blahblah" line? [solved]


Steve Scrimpshire
 Share

Recommended Posts

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 by Steve Scrimpshire
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...