[TriLUG] override dhcp's dns
Aaron S. Joyner
aaron at joyner.ws
Sat Jun 19 11:49:49 EDT 2004
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