how to static /etc/resolv.conf

Asked by Marcelo on 2008-12-21

the network manager constantly overwrite the DNS that I write in /etc/resolv.conf and put incorrect DNS...

I'm using movile broadband connection and huawei e 226 modem and the problem is with DNS, because the connection is establishing but i have no ping and no resolution.

please i need to know how to hace static /etc/resolv.conf (using network manager to manage the connection)

thanks in advance!

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Last query:
Last reply:

Ubuntu 8.10 DNS dont' works

If you can open the page and not is a DNS issue... so please try:

Migth be related to this bug

As a workaround please try to set OpenDns dns server
into your resolv.conf and lock it:

Open a Terminal from the menu Applications → Accessories → Terminal and type:
(when the system ask you a password give your user password, you will not see nothing when you type it, then press enter)

sudo gedit /etc/resolv.conf

add this rows as first DNS server (you can also put your provider DNS instead of OpenDNS servers)


save and exit

Then to avoid other modification from other program, lock your resolv.conf, still sing terminal type:

sudo chattr +i /etc/resolv.conf

Then try... if still this doesn't works please rebbot your pc, and try again.

Hope this helps

Marcelo (marceloramone-gmail) said : #2

After do the changes for you related marcobra, (but with the ISP DNSs instead openDNSs) the connection was disabled and is impossible to enable again.

I Think this method doesn't works.-

Restore the /etc/resolv.conf attribute

sudo chattr -i /etc/resolv.conf

and then try this:

sudo gedit /etc/dhcp3/dhclient.conf

give your user password when requested, you don't see nothing when you type it, then press enter.

Change the prepend line to read:

prepend domain-name-servers,;

save and exit and restart your newortk:

sudo /etc/init.d/networking restart

Hope This Help

Can you help with this problem?

Provide an answer of your own, or ask Marcelo for more information if necessary.

To post a message you must log in.