![]() |
how to avoid resolv.conf been modified by dhcp-client
everytime i reboot, the nameserver in resolv.conf was modified. I checked the threads and it was said dhcp-client get something from dhcp-server and prepend those info in resolv.conf.
It keeps irrating me since I had to change the nameserver to a working one in order to access internet. can anyone tell me where is the source for the information dhcp-client get from dhcp-server? or is there anyway I can forbid dhcp-client modifying resolv.conf? Thanks Septanla |
It depends on your linux distro since you dont name one i canīt give you an answer.
|
Dhcp
If you are using DHCP to get IP addresses and nameserver
addresses then everytime you boot it will write a temporary resolve.conf file. It has to do this to write in the nameserver addresses obtained through DHCP since these might change. If you want to change something in resolve.conf then turn off DHCP make your changes and turn it on again. DHCP can be configured to obtain 1. Your computers IP address 2. Your hostname 3. Nameserver IP addresses. You should also be able to turn off any of these parts of the DHCP service without effecting the others. How you do this depends upon your linux distribution. Many distibutions also have a resolve.conf.local file for adding in information you don't want to change. |
Hi,
you can edit/create a /etc/dhclient.conf to explicitly tell which parameter you want to set up through dhcp queries... remove the domain-name-servers value from the require and request strings, and add a line like "option domain-name-servers 127.0.0.1;" in the section concerning your NIC... that should be it. More info on man dhclient.conf |
All times are GMT -5. The time now is 08:00 PM. |