Re: dhcp option to *not* overwrite /etc/resolv.conf

2002-10-29 Thread Dan Pelleg

> Hi,
>
> I have read the man pages, searched a few forums, but I did not found a
> way to prevent dhcp to do not change my /etc/resolv.conf. I do not have


You can write a script to fix resolv.conf right after dhclient ruined
it. The way to do it is to hook it from /etc/dhclient-exit-hooks
(which you'll need to create). Here's mine, which calls two other scripts (not
included), one of which only if the IP address actually changed. This one
also gets the new servers as arguments.


-- /etc/dhclient-exit-hooks

# nothing to do unless we're bound
case ${reason} in
BOUND | RENEW | REBIND | REBOOT )
[ -x /etc/set-ntp ] && . /etc/set-ntp
if [ -n "${new_domain_name_servers}" ]; then
if [ -z "${old_domain_name_servers}" ] || [ x${old_ip_address} != 
x{$new_ip_address} ]; then
[ -x /etc/refresh-named ] && /etc/refresh-named 
${new_domain_name_servers}
fi
fi
;;
esac

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: dhcp option to *not* overwrite /etc/resolv.conf

2002-10-28 Thread Eric Thornton
add this to your /etc/dhclient.conf

interface "(outside interface)" {
supersede domain-name-servers (preferred DNS);
}

you can alternately use prepend domain-name-servers to add your DNS to the
TOP of the resolv.conf list.



- Original Message -
From: "Paulo Roberto" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 28, 2002 5:11 PM
Subject: dhcp option to *not* overwrite /etc/resolv.conf


> Hi,
>
> I have read the man pages, searched a few forums, but I did not found a
> way to prevent dhcp to do not change my /etc/resolv.conf. I do not have
> access to the dhcp server configuration, so I need to change it on my
> client. I also tried to chmod it to only read mode, but that did not
> work out. Any tips?
>
> thanks
>
> Paulo
>
> __
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site
> http://webhosting.yahoo.com/
>
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-questions" in the body of the message
>



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: dhcp option to *not* overwrite /etc/resolv.conf

2002-10-28 Thread Robin Damm
On Mon, Oct 28, 2002 at 02:11:48PM -0800, Paulo Roberto wrote:
> Hi,
> 
> I have read the man pages, searched a few forums, but I did not found a
> way to prevent dhcp to do not change my /etc/resolv.conf. I do not have
> access to the dhcp server configuration, so I need to change it on my
> client. I also tried to chmod it to only read mode, but that did not
> work out. Any tips?

man dhclient.conf

As an example my /etc/dhclient.conf contains the following:

interface "ed0" {
supersede domain-name-servers 127.0.0.1;
append domain-name " example.com";
}

The resulting /etc/resolv.conf looks like this:

search isp.domain.com example.com
nameserver 127.0.0.1

-- 
Robin Damm <[EMAIL PROTECTED]>

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: Re: dhcp option to *not* overwrite /etc/resolv.conf

2002-10-28 Thread Steve Wingate
> > I have read the man pages, searched a few forums, but I did not found a
> > way to prevent dhcp to do not change my /etc/resolv.conf. I do not have
> > access to the dhcp server configuration, so I need to change it on my
> > client. I also tried to chmod it to only read mode, but that did not
> > work out. Any tips?
> >

Depending what it is you want to not be overwritten you should be able to achieve the 
desired results throught supersede and/or prepend statements in dhcp.conf.
OpenBSD supports use of a resolv.conf.tail file that also hold entries you don't want 
overwritten (no idea about FreeBSD).


Work like you don't need the money
Dance like nobody's watching
Love like you've never been hurt


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: dhcp option to *not* overwrite /etc/resolv.conf

2002-10-28 Thread Philip Hallstrom
Never tried it, but you could look for the spot in the various rc* files
that setup dhcp and once it's done re-write /etc/resolv.conf with what you
want it to be...

?

On Mon, 28 Oct 2002, Paulo Roberto wrote:

> Hi,
>
> I have read the man pages, searched a few forums, but I did not found a
> way to prevent dhcp to do not change my /etc/resolv.conf. I do not have
> access to the dhcp server configuration, so I need to change it on my
> client. I also tried to chmod it to only read mode, but that did not
> work out. Any tips?
>
> thanks
>
> Paulo
>
> __
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site
> http://webhosting.yahoo.com/
>
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-questions" in the body of the message
>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



dhcp option to *not* overwrite /etc/resolv.conf

2002-10-28 Thread Paulo Roberto
Hi,

I have read the man pages, searched a few forums, but I did not found a
way to prevent dhcp to do not change my /etc/resolv.conf. I do not have
access to the dhcp server configuration, so I need to change it on my
client. I also tried to chmod it to only read mode, but that did not
work out. Any tips?

thanks

Paulo

__
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message