web-dev-qa-db-ja.com

DNS名をpingできず、IPのみをpingでき、その結果、apt-get更新が失敗する場合、これを修正する方法

パッケージをインストールしようとしていますが、DNSに到達できませんが、IPにDNSを追加すると手動で機能しますが、最後のDNSレコードが失敗します。

# 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
1
YumYumYum

どのDNSサーバーを使用していますか? 「システム設定」を開き、「ネットワーク」に移動します。そこからDNSサーバーを変更できます。 ISPには使用可能なサーバーが必要ですが、他のサーバーを試すこともできます。 Googleには8.8.8.88.8.4.4に2台のサーバーがあり、それらが私に役立つことを知っています。

DNSの問題をデバッグするには、Digとpingを使用できます。これらのコマンドを試してください:

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

値は、たとえば次のとおりです。

 Dig ubuntu.com
 ping 8.8.8.8

DNSサーバーの変更が機能しない場合は、上記のコマンドの出力をここに投稿してください。

3
Kalle Elmér