Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
127.0.0.1   localhost
127.0.1.1   sun-Alienware-X51
91.189.91.15    us.archive.ubuntu.com
91.189.92.152   extras.ubuntu.com
91.189.92.184   security.ubuntu.com
91.189.94.156       ubuntu.com

# 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 ubuntu.com

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

#/var/tmp/dist# apt-get update
Ign http://us.archive.ubuntu.com precise InRelease
Ign http://us.archive.ubuntu.com precise-updates InRelease                                                                    
Ign http://us.archive.ubuntu.com precise-backports InRelease                                                                  
Err http://extras.ubuntu.com precise InRelease                                                           

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

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release.gpg  Unable to connect to extras.ubuntu.com:http:

W: Some index files failed to download. They have been ignored, or old ones used instead.
#/var/tmp/dist# ping extras.ubuntu.com
PING extras.ubuntu.com (91.189.92.152) 56(84) bytes of data.
64 bytes from extras.ubuntu.com (91.189.92.152): icmp_req=1 ttl=50 time=111 ms
64 bytes from extras.ubuntu.com (91.189.92.152): icmp_req=2 ttl=50 time=111 ms
^C
--- extras.ubuntu.com 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
add comment

2 Answers

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 8.8.8.8 and 8.8.4.4 that work for me.

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

dig <some-domain.com>
ping <DNS-server-IP-address>

The values could be, for example:

 dig ubuntu.com
 ping 8.8.8.8

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

share|improve this answer
    
1) # dig ubuntu.com ; <<>> DiG 9.8.1-P1 <<>> ubuntu.com ;; 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
add comment

I could not resolve any name when trying to

ping google.co.uk 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
add comment

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.