Networking Forums

Networking Forums > Computer Networking > Linux Networking > search path in resolv.conf overwritten by the hostname after reboot

Reply
Thread Tools Display Modes

search path in resolv.conf overwritten by the hostname after reboot

 
 
powah
Guest
Posts: n/a

 
      04-06-2009, 01:00 PM
Before reboot,
$ cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 172.20.10.22
search mycomp.local myhost.com

After reboot, the search path in resolv.conf is overwritten by the
hostname.
Please help to setup the search path properly.
Thanks.
$ cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 172.20.10.22
search penguin

I do not want to apply the brute force method:
# chattr +i /etc/resolv.conf

$ cat /etc/dhclient.conf
request subnet-mask, broadcast-address, routers, domain-name, domain-
name-servers, host-name, nis-domain, nis-servers;

My computer use FC6:
$ uname -a
Linux penguin 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2006
i686 i686 i386 GNU/Linux
 
Reply With Quote
 
 
 
 
Bill Marcum
Guest
Posts: n/a

 
      04-06-2009, 08:05 PM
On 2009-04-06, powah <(E-Mail Removed)> wrote:
>
>
> Before reboot,
> $ cat /etc/resolv.conf
> ; generated by /sbin/dhclient-script
> nameserver 172.20.10.22
> search mycomp.local myhost.com
>
> After reboot, the search path in resolv.conf is overwritten by the
> hostname.
> Please help to setup the search path properly.
> Thanks.
> $ cat /etc/resolv.conf
> ; generated by /sbin/dhclient-script
> nameserver 172.20.10.22
> search penguin
>
> I do not want to apply the brute force method:
> # chattr +i /etc/resolv.conf
>
> $ cat /etc/dhclient.conf
> request subnet-mask, broadcast-address, routers, domain-name, domain-
> name-servers, host-name, nis-domain, nis-servers;
>
> My computer use FC6:
> $ uname -a
> Linux penguin 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2006
> i686 i686 i386 GNU/Linux


Change /etc/dhclient.conf not to request domain-name, or request
domain-search and configure the dhcp server to provide the search path,
or create a dhclient-exit-hook script. Ubuntu uses scripts in
/etc/dhcp3/dhclient-exit-hooks.d; Fedora may be different. By the way,
you might consider upgrading to a newer version of Fedora.

 
Reply With Quote
 
minlu_us@yahoo.com
Guest
Posts: n/a

 
      04-15-2009, 10:19 PM
On Apr 6, 9:00*am, powah <wong_po...@yahoo.ca> wrote:
> Before reboot,
> $ cat /etc/resolv.conf
> ; generated by /sbin/dhclient-script
> nameserver 172.20.10.22
> search mycomp.local myhost.com
>
> After reboot, the search path in resolv.conf is overwritten by the
> hostname.
> Please help to setup the search path properly.
> Thanks.
> $ cat /etc/resolv.conf
> ; generated by /sbin/dhclient-script
> nameserver 172.20.10.22
> search penguin
>
> I do not want to apply the brute force method:
> # chattr +i /etc/resolv.conf
>
> $ cat /etc/dhclient.conf
> request subnet-mask, broadcast-address, routers, domain-name, domain-
> name-servers, host-name, nis-domain, nis-servers;
>
> My computer use FC6:
> $ uname -a
> Linux penguin 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2006
> i686 i686 i386 GNU/Linux



All you need to do is add a file /etc/dhclient-enter-hooks that
contains:
make_resolv_conf( ) {
logger -t "dhclient-enter-hooks" "Doing nothing to /et/
resolv.conf"
}


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
resolv.conf is empty ? subrato Linux Networking 7 02-06-2006 02:23 PM
dhcpd.conf, resolv.conf and the search directive Andy Richardson Linux Networking 4 07-13-2005 08:23 AM
resolv.conf usage Bit Twister Linux Networking 3 11-16-2004 04:00 AM
resolv.conf Stephen Speicher Linux Networking 5 12-10-2003 09:00 AM
NIS, DNS and resolv.conf ncrfgs Linux Networking 2 10-02-2003 05:09 PM



1 2 3 4 5 6 7 8 9 10 11