resolv.conf getting wiped when I plug in devices

Asked by myxiplx

Twice now I've seen my internet access die after plugging in devices, with name resolution failing completely. Both times it appears that resolv.conf is being wiped, ending up an empty file with just a line "'# Created by Network Manager".

This has now happened after plugging in a USB network router, and a USB mobile phone. Adding my domain and DNS servers to the file manually appears to fix the problem, but does anybody know how I can stop it happening, or why Ubuntu is loosing my network settings like this?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Guillermo Belli
Solved:
Last query:
Last reply:
Revision history for this message
krithispd (krithispd) said :
#1

i can't connect wiereless to my adsl router connection

Revision history for this message
myxiplx (myxiplx) said :
#2

Dear god, I can see the "This solved my problem" button. Now I just need Ubuntu to add a "

Revision history for this message
myxiplx (myxiplx) said :
#3

whoops, hit enter. Was going to say, now we need launchpad to add a "that comment was completely irrelevant" button.

Revision history for this message
Best Guillermo Belli (glock24) said :
#4

Sometimes, when using a DHCP connection, the resolv.conf file gets overwritten, that's probably what happens when you plug the USB router or phone.

To get over this issue, edit /etc/dhcp3/dhclient.conf and add this line:

prepend domain-name-servers 208.67.222.222,208.67.220.220;

Those are IP addresses for OpenDNS, change with your own addresses.

Hope it helps.

Revision history for this message
myxiplx (myxiplx) said :
#5

Thanks, I'll give that a try. Do I need to raise this as a bug with Ubuntu? Surely it's not normal to loose your network settings when you plug in a phone?

Revision history for this message
myxiplx (myxiplx) said :
#6

Thanks Guillermo Belli, that solved my question.

Revision history for this message
Guillermo Belli (glock24) said :
#7

Yes I consider this a bug too, so you should report it as a bug.