0

I am using Ubuntu 12.04. I am doing Internet with a USB Modem of 236kbps. My issue is that if I am accessing a web page through a browser it works, but if I am doing sudo apt-get update in a terminal, there is no response. Please help me to solve this.

One more thing; I am unable to change my DNS settings.

raja@badfox:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 220.226.100.40
nameserver 220.226.6.104
nameserver 127.0.0.1

I want to replace these addresses with ones linked here http://www.cyberciti.biz/faq/free-dns-server/.

See the picture to have some idea about my issue .enter image description here

jdthood
  • 12,625
Raja G
  • 105,327
  • 107
  • 262
  • 331

2 Answers2

2

In Ubuntu 12.04 changes were made to DNS resolving, announced here; also see the resolvconf man page.

Changes state that

resolvconf is a set of script and hooks managing DNS resolution. The most notable difference for the user is that any change manually done to /etc/resolv.conf will be lost as it gets overwritten next time something triggers resolvconf. Instead, resolvconf uses DHCP client hooks, a Network Manager plugin and /etc/network/interfaces to generate a list of nameservers and domain to put in /etc/resolv.conf.

"I use static IP configuration, where should I put my DNS configuration?"

The DNS configuration for a static interface should go as “dns-nameservers”, “dns-search” and “dns-domain” entries added to the interface in /etc/network/interfaces


To try from Older method i.e. prior to Ubuntu 12.04 edition

NOTE: Before you change your DNS settings to use Google Public DNS or OpenDNS, be sure to backup the current server addresses or settings somewhere. It is very important that you keep these numbers for backup purposes, in case you need to revert to them at any time.

Option A: Changing DNS server settings on Ubuntu can be configured through Network Manager.

In the System Settings..., go to Network, then Select the connection for which you want to configure Google Public DNS.

  • To change the settings for an Ethernet connection, select the Wired tab, then select your network interface in the list. It is usually called eth0.

  • To change the settings for a Wireless connection, select the Wireless tab, then select the appropriate wireless network.

  • Click Edit, and in the window that appears, select the IPv4 Settings or IPv6 Settings tab according to your needs.

  • If the selected method is Automatic (DHCP), open the dropdown and select Automatic (DHCP) addresses only instead. If the method is set to something else, do not change it.

  • In the DNS servers field, enter the Google Public DNS IP addresses, separated by a space:

    For IPv4:

    8.8.8.8 and/or 8.8.4.4
    

    For IPv6:

    2001:4860:4860::8888 and/or 2001:4860:4860::8844
    
  • Click Apply to save the change. If you are prompted for a password or confirmation, type the password or provide confirmation. Test your settings here.

Option B: Alternately through CLI

  • Edit /etc/resolv.conf:

    sudo gedit /etc/resolv.conf
    
  • If any nameserver lines appear, backup the IP addresses for future reference.

  • Replace the nameserver lines with, or ADD the following lines:

    For IPv4:

    nameserver 8.8.8.8
    nameserver 8.8.4.4
    

    You can select your Linked addresses here.

    For IPv6:

    nameserver 2001:4860:4860::8888
    nameserver 2001:4860:4860::8844
    
  • Save and exit. And again test it from above link.

Source.

Peachy
  • 7,235
  • 10
  • 40
  • 47
atenz
  • 12,858
1

First(optional), select a better mirror. Launch Synaptic Package Manager. Then click "Setting" → "Repositories". select the download source that's closest to you. [Drawback of this step: some local mirror is not updated.]

Then, install apt-fast with the following instruction: http://www.webupd8.org/2010/08/you-can-now-install-apt-fast-from-ppa.html

Finally, create symbolic link by running:

sudo mv /usr/bin/apt-get /usr/bin/apt-get_BACKUP

and then run

sudo ln /usr/bin/apt-get_BACKUP /usr/bin/apt-get

If you encounter any problem, says apt-get no longer work, run this:

sudo rm /usr/bin/apt-get

then this:

sudo mv /usr/bin/apt-get_BACKUP /usr/bin/apt-get

Hope it helps.

EDIT: This issue seems irrelevant to DNS server. According to your photo, it shows a slow download speed/ unstable connection, instead of high domain name resolution delay. Anyway, if you want to use another DNS server, consider OpenDNS. Also, the maximum transfer rate of your modem is 236kbps, i.e. 29.5KB per second. Don't expect a fast Internet connection.

Konfle Dolex
  • 111
  • 3