For When You Can't Have The Real Thing
[ start | index | login ]
start > Linux > resolv.conf and dhcp clients

resolv.conf and dhcp clients

Created by dave. Last edited by dave, 2 years and 196 days ago. Viewed 1,036 times. #3
[diff] [history] [edit] [rdf]
labels
attachments

Problem

I have an internet-facing linux system which uses DHCP for its internet interface. The DHCP client re-writes my /etc/resolv.conf, which prevents me from using the nameserver installed on it. I don't want to use the DHCP-provided nameservers, I want to use the local one.

Solution

Make your change to /etc/resolv.conf, then mark it as immutable:

# chattr +i /etc/resolv.conf
# lsattr /etc/resolv.conf
----i-------- /etc/resolv.conf

Kind of a hack, but it works.

RedHat users might enjoy Stop DHCP from changing resolv.conf instead.

no comments | post comment

Virtual Dave Megaplex:

Internet Explorer 6 Users >>Click Here

(read this note about local search)

Logged in Users: (1)
… and a Guest.


Editing: snipsnap-help, Image Macro

Installed 2 years and 131 days ago
Powered By >>SnipSnap Version 1.0b1-uttoxeter

This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt