[TriLUG] override dhcp's dns
Myrhillion
lug at blackwizard.net
Sat Jun 19 14:02:25 EDT 2004
you could just make /etc/resolv.conf immutable after you've edited it,
until you want to update it.
You just have to remember you did this...
chattr +i /etc/resolv.conf
lsattr /etc/resolv.conf
Doug Taggart
Aaron S. Joyner wrote:
> Jon Carnes wrote:
>
>> On Sat, 2004-06-19 at 04:27, Michael Hrivnak wrote:
>>
>>
>>> I followed the list advice and setup a simple cacheing dns server.
>>> I works great for clinets, but not on the gateway itself (on which
>>> named is running). RR has its own ideas about what DNS servers it
>>> should use. How do I tell my machine to ignore what dhcp says about
>>> DNS and use itself instead?
>>>
>>> Thanks a ton,
>>>
>>> Michael
>>>
>>
>>
>> In /etc/resolv.conf put
>> nameserver 127.0.0.1
>>
>> as the first entry. That tells the machine to use itself first for DNS.
>>
>> HTH - Jon Carnes
>>
>>
>>
> And to make it stick, you'll need to tell your DHCP client not to
> update /etc/resolv.conf (as it likely will do, next time you acquire a
> new lease). This varies from distribution to distribution, but
> generally if you're using the older versions of isc's dhcpcd (ala RH
> 7.x) you need to pass it an argument of -R to tell it not to update
> the /etc/resolv.conf. If you're running something like dhclient
> (RedHat 9, maybe newer), you'll need to create a
> /etc/dhclient-enter-hooks with a replacement function for
> make_resolve_conf(), something like this: function make_resolv_conf()
> { echo; } On a BSD box you're going to need to add an appropriate
> parameter to /usr/local/etc/rc.conf to pass the right args to dhcpcd
> or dhclient, depending on your version, etc. :)
>
> More generally speaking, read the docs for your dhcp client. :)
>
> Aaron S. Joyner
More information about the TriLUG
mailing list