Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I am trying to install packages but it can not reach any DNS but manually when i add DNS to IP it works but still the last DNS record is failing.

# cat /etc/hosts   localhost   sun-Alienware-X51

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

# dig

; <<>> DiG 9.8.1-P1 <<>>
;; global options: +cmd
;; connection timed out; no servers could be reached

#/var/tmp/dist# apt-get update
Ign precise InRelease
Ign precise-updates InRelease                                                                    
Ign precise-backports InRelease                                                                  
Err precise InRelease                                                           

Err precise Release.gpg                                                         
  Unable to connect to
Hit precise Release.gpg
Hit precise-updates Release.gpg
Ign precise-security InRelease
Hit precise-backports Release.gpg
Hit precise Release
Hit precise-security Release.gpg           
Hit precise-updates Release
Hit precise-backports Release            
Hit precise/main Sources                 
Hit precise/restricted Sources           
Hit precise/universe Sources             
Hit precise/multiverse Sources           
Hit precise/main amd64 Packages          
Hit precise-security Release
Hit precise/restricted amd64 Packages
Hit precise/universe amd64 Packages
Hit precise/multiverse amd64 Packages
Hit precise/main i386 Packages
Hit precise/restricted i386 Packages
Hit precise/universe i386 Packages
Hit precise/multiverse i386 Packages
Hit precise/main TranslationIndex
Hit precise/multiverse TranslationIndex
Hit precise/restricted TranslationIndex
Hit precise/universe TranslationIndex
Hit precise-updates/main Sources
Hit precise-updates/restricted Sources
Hit precise-updates/universe Sources
Hit precise-updates/multiverse Sources
Hit precise-updates/main amd64 Packages
Hit precise-updates/restricted amd64 Packages
Hit precise-updates/universe amd64 Packages
Hit precise-updates/multiverse amd64 Packages
Hit precise-updates/main i386 Packages
Hit precise-updates/restricted i386 Packages
Hit precise-updates/universe i386 Packages
Hit precise-updates/multiverse i386 Packages
Hit precise-updates/main TranslationIndex
Hit precise-security/main Sources
Hit precise-updates/multiverse TranslationIndex
Hit precise-updates/restricted TranslationIndex
Hit precise-updates/universe TranslationIndex
Hit precise-backports/main Sources
Hit precise-backports/restricted Sources
Hit precise-backports/universe Sources
Hit precise-backports/multiverse Sources
Hit precise-backports/main amd64 Packages
Hit precise-backports/restricted amd64 Packages
Hit precise-backports/universe amd64 Packages
Hit precise-backports/multiverse amd64 Packages
Hit precise-backports/main i386 Packages
Hit precise-backports/restricted i386 Packages
Hit precise-backports/universe i386 Packages
Hit precise-backports/multiverse i386 Packages
Hit precise-security/restricted Sources
Hit precise-security/universe Sources
Hit precise-security/multiverse Sources
Hit precise-security/main amd64 Packages
Hit precise-security/restricted amd64 Packages
Hit precise-backports/main TranslationIndex
Hit precise-backports/multiverse TranslationIndex
Hit precise-backports/restricted TranslationIndex
Hit precise-backports/universe TranslationIndex
Hit precise/main Translation-en
Hit precise/multiverse Translation-en
Hit precise/restricted Translation-en
Hit precise/universe Translation-en
Hit precise-updates/main Translation-en
Hit precise-updates/multiverse Translation-en
Hit precise-updates/restricted Translation-en
Hit precise-updates/universe Translation-en
Hit precise-backports/main Translation-en
Hit precise-backports/multiverse Translation-en
Hit precise-backports/restricted Translation-en
Hit precise-backports/universe Translation-en
Hit precise-security/universe amd64 Packages
Hit precise-security/multiverse amd64 Packages
Hit precise-security/main i386 Packages
Hit precise-security/restricted i386 Packages
Hit precise-security/universe i386 Packages
Hit precise-security/multiverse i386 Packages
Hit precise-security/main TranslationIndex
Hit precise-security/multiverse TranslationIndex
Hit precise-security/restricted TranslationIndex
Hit precise-security/universe TranslationIndex
Hit precise-security/main Translation-en
Hit precise-security/multiverse Translation-en
Hit precise-security/restricted Translation-en
Hit precise-security/universe Translation-en
Reading package lists... Done
W: Failed to fetch  

W: Failed to fetch  Unable to connect to

W: Some index files failed to download. They have been ignored, or old ones used instead.
#/var/tmp/dist# ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_req=1 ttl=50 time=111 ms
64 bytes from ( icmp_req=2 ttl=50 time=111 ms
--- ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 111.371/111.614/111.858/0.413 ms
share|improve this question

2 Answers 2

up vote 2 down vote accepted

What DNS servers are you using? Open "System Settings" and go to "Network". You can change DNS servers from there. Your ISP should have servers that you can use, but you can also try something else. I know that Google has two servers at and that work for me.

To debug DNS issues you can use dig and ping. Try these commands:

dig <>
ping <DNS-server-IP-address>

The values could be, for example:


If changing DNS servers doesn't work, post the output of the above commands here.

share|improve this answer
1) # dig ; <<>> DiG 9.8.1-P1 <<>> ;; global options: +cmd ;; connection timed out; no servers could be reached 2) ping is ok –  YumYumYum Oct 24 '12 at 9:14
1. What DNS servers are used by your system? 2. What address did you ping? –  Kalle Elmér Oct 25 '12 at 18:15

I could not resolve any name when trying to

ping having checked my /etc/networks/interfaces i found i had no server running an couldnt start it. so i reinstalled it with

sudo apt-get install bind9

Then reboot, and sudo apt-get update works! so does sudo tasksel which is what i stopped in the middle of working that caused the hole mess!

share|improve this answer
You don't need to run your own DNS server! –  guntbert Aug 14 '13 at 21:16

Your Answer


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.