Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need to use the open DNS : 208.67.222.222,208.67.220.220 in my network connection.

I use etisalat 3.75 USB modem HUAWEI in my Ubuntu 12.04 PC.

I had tried to add this DNS in :

/etc/network/interfaces

/etc/resolv.conf

with no success.

share|improve this question
    
Is your network setup being managed by NetworkManager? –  slm Feb 21 at 2:07
    
No, the installation package replace the networkmanager. –  tabebqena Feb 21 at 19:14
    
The details outlined in step #1 in my A should do the trick then. –  slm Feb 21 at 19:41

1 Answer 1

up vote 0 down vote accepted

I'm not sure if your USB modem's network connection is managed by NetworkManager or not. If the network setup is static then you should be able to change the default DNS servers using the info in section #1, otherwise see the details in section #2.

1. DNS resolution using /etc/resolv.conf

On a Unix system there is a file called nsswitch.conf which controls how names of various things get resolved. For example, host names would be governed by this line in that file:

hosts:      files mdns4_minimal [NOTFOUND=return] dns

This line says:

  • Look to "files" first (such as /etc/hosts).
  • Next try "mdns4_minimal" which means try to resolve the name using Multicast DNS.
  • The "NOTFOUND" means that any response of notfound by the preceeding mdns4_minimal process should be treated as authoritative and that the system should not try to continue hunting for an answer.
  • Lastly the "dns" parameter means to use a legacy unicast DNS query.

When the name is attempting to be resolved via mdns4_minimal the file /etc/resolv.conf will be consulted to determine things such as:

  • nameservers to query
  • default search domain name
  • default domain name

For example:

domain somedom.net.
search somedom.net.
nameserver 208.67.222.222
nameserver 208.67.220.220

So to control your default DNS server you'd need to change the DNS server settings in this file, /etc/resolv.conf.

2. NetworkManager

If your network connection is being managed by NetworkManager then you can change the DNS settings through its configuration applets like so.

  1. open NetworkManager's main menu

                                     ss #1

                             ss #2

  2. Open IPv4 tab

             ss dns #1

  3. Add DNS servers

    ss dns #2

  4. Confirm

    After adding the IP's for the DNS servers to NetworkManager's interface if you check the file, /etc/resolv.conf` you'll see them as follows:

    nameserver 208.67.222.222
    nameserver 208.67.220.220
    

References

share|improve this answer
    
Thanks for the idea #1, I have figured out that the USB_modem change that files (/etc/hosts & /etc/resolv.conf ) on its startup, so I will design python script to overwrite its changes. –  tabebqena Feb 23 at 12:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.