[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dhclient.conf: prepend domain-name-servers doesn't influence resolv.conf



Joel Roth <joelz@pobox.com> writes:

> Hi all,
>
> I've set up dnsmasq in order to:
>
> - cache my DNS queries.
> - use nameservers of my choice (instead of my ISP's)
>
> That part is working fine.
>
> I can manually set /etc/resolv.conf to:
>
> 	nameserver 127.0.0.1
>
> And I find dnsmasq handles DNS queries for me.
> Now, I want to make this permanent.
>
> I'm having trouble configuring /etc/dhcp3/dhclient.conf.
> According to various docs, if I include the line:
>
> 	prepend domain-name-servers 127.0.0.1
>
> I am expecting that a lease renewal should put this
> line in resolv.conf:
>
> 	nameserver 127.0.0.1
>
> I was expecting something like:
>
> 	domain hawaiiantel.net
> 	search hawaiiantel.net
> 	nameserver 127.0.0.1
> 	nameserver 192.168.0.1  # router's address
>
> But after /etc/init.d/networking restart I get the same
> resolv.conf as usual:
>
> 	domain hawaiiantel.net
> 	search hawaiiantel.net
> 	nameserver 192.168.0.1
>
> If this much would work, I would further like to add to dhclient.conf:
>
> 	do-forward-updates false
>
> To get something like:
>
> 	domain hawaiiantel.net
> 	search hawaiiantel.net
> 	nameserver 127.0.0.1
>
> To be honest, I don't understand how the 'domain' and 'search'
> fields affect my system's behavior.
>
> Can anyone comment on why dhclient.conf doesn't influence
> the resolv.conf after a networking restart?

I have used the prepend statement to use dnsmasq and it works without
any problems.  The one difference is that I have always killed dhclient
and restarted it manually to have it take effect immediately.  It may be
that a networking restart doesn't restart dhclient if it is already running.

-- 
Carl Johnson		carlj@peak.org


Reply to: