how to prevent dhcp modify /etc/resolv.conf
Hello,
if I use following lines in /etc/network/
auto eth0
iface eth0 inet dhcp
after each time I run "/etc/init.
please help me implement it, thanks.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu ifupdown Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- LI Daobing
- Solved:
- 2007-02-11
- Last query:
- 2007-02-11
- Last reply:
- 2007-02-11
What is your dhcp server? Could you tell the dhcp server to give out the opendns server IPs rather than the broken ones?
|
|
#2 |
I have found the answer on http://
<quote>
Using OpenDNS with DHCP
If you assign your computer's IP with DHCP, it probably overwrites your /etc/resolv.conf. Here's how to fix that:
1. Run: sudo gedit /etc/dhcp3/
2. Change the prepend line to read:
prepend domain-name-servers 208.67.222.222, 208.67.220.220;
This will prepend the OpenDNS addresses to the top of the list. (You can also use "supersede", which will just use them.) You don't have to worry about the DHCP client overwriting settings on each reboot or lease cycle, and your ISP nameservers will still be used as backup.
3. Run: sudo /etc/init.
4. Using Ubuntu? Check "Networking" to see if the changes applied correctly.
Go to "System β> Administration β> Networking" and click the DNS tab.
</quote>

