Ubuntuサーバーはインターネットにアクセスできません。 DNS関連が表示されます。

Ubuntuサーバーはインターネットにアクセスできません。 DNS関連が表示されます。

これはLinodeでUbuntu 12.04 LTSを実行しているDrupalのウェブサイトです。サーバーはただのウェブサイトです。 DNSサーバーや他のものではありません。

これが私の問題です。どちらもDNS問題に関連しているようです。 (私は数日間Linodeでこの問題を解決してきました、ここからiptablesの助けを借りてください。今、私はこの質問の問題に焦点を当てることができます。 )

  1. サーバーが外部サービスにアクセスできないため、Mollomスパム対策はDrupalサイトでは機能しません。 (詳細は下から)

  2. Drupalレポート:「あなたのシステムまたはネットワーク構成のためにDrupalがWebページにアクセスすることを許可されていないため、機能が低下しました。」(詳細については、以下を参照してください。

  3. サーバーはインターネットをpingできません。

    ping google.com  
    ping: unknown host google.com
    
  4. 他のネットワークサービスが失敗しました。たとえば、

    $ sudo ntpdate ntp.ubuntu.com
    Exiting, name server cannot be used: Temporary failure in name resolution (-3) 1 Jun 16:42:34 ntpdate[7420]: name server cannot be used: Temporary failure in name resolution (-3)  
    apt-get update
    Err http://us.archive.ubuntu.com precise Release.gpg                        
      Temporary failure resolving 'us.archive.ubuntu.com'
    Err http://security.ubuntu.com precise-security Release.gpg                 
      Temporary failure resolving 'security.ubuntu.com'
    
  5. サーバーが正しく機能していません。以下のエラーはインターネットにアクセスできないことに関連していますか?

    Out of memory: Kill process 2300 (mysqld) score 129 or sacrifice child
    Killed process 2300 (mysqld) total-vm:354780kB, anon-rss:53180kB, file-rss:0kB
    Out of memory: Kill process 5937 (mysqld) score 60 or sacrifice child
    Killed process 5937 (mysqld) total-vm:344040kB, anon-rss:78988kB, file-rss:0kB
    

Drupalエラーの詳細は次のとおりです。これらのエラーが発生する前は、(私が知っている限り) Drupal 設定に変更はありませんでした.

  1. HTTP 要求の状態に失敗しました システムまたはネットワークの構成により、Drupal が Web ページにアクセスすることができないため、機能が低下しました。これはWebサーバーの設定やPHP設定によって発生する可能性があり、利用可能なアップデートに関する情報をダウンロードしたり、コレクタフィードをインポートしたり、OpenIDを介してログインしたり、他のネットワーク依存サービスを使用したりするには解決する必要があります。 Drupalがページにアクセスできると確信していますが、まだこのメッセージが表示されている場合は、$ conf ['drupal_http_request_fails'] = FALSE;をsettings.phpファイルの下部に追加できます。

  2. Mollom API keys Service error
    The Mollom API keys could not be verified. Please try again later.
    This issue prevents members from registering for our site or posting comments.
    

私が考えるのに関連性があると思われる内容は次のとおりです。

root@example1:/etc# 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 789.456.123.6
nameserver 789.456.123.7

root@example1:/etc# cat /etc/hosts
#127.0.0.1      localhost
127.0.1.1       example1.local          example1
192.168.150.8   example1                example1
123.456.789.55  example1.example.com    example1        www.example.com

root@example1:/etc# cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis


root@example1:/etc# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         123.456.789.1   0.0.0.0         UG    100    0        0 eth0
123.456.789.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.100.0   0.0.0.0         255.255.128.0   U     0      0        0 eth0


root@example1:/etc# cat /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# This line ensures that the interface will be brought up during boot.
auto eth0 eth0:0

iface eth0 inet static
 address 123.456.789.55
 netmask 255.255.255.0
 gateway 123.456.789.1
 dns-nameservers 789.456.123.6 789.456.123.7

# eth0:0 - Private IPs have no gateway (they are not publicly routable) so all you need to specify is the address and netmask.
iface eth0:0 inet static
 address 192.168.150.8
 netmask 255.255.128.0

root@example1:/etc# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN 
    link/ether 76:49:bf:95:98:68 brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.150.8/17 brd 192.168.255.255 scope global eth0:0
       valid_lft forever preferred_lft forever
    inet 123.456.789.55/24 brd 123.456.789.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 1000:aaaa::aaaa:aaaa:aaaa:aaa/64 scope global dynamic 
       valid_lft 2591730sec preferred_lft 604530sec
    inet6 fe80::aaaa:aaa:fffff:ffff/64 scope link 
       valid_lft forever preferred_lft forever
4: teql0: <NOARP> mtu 1500 qdisc noop state DOWN qlen 100
    link/void 
5: tunl0: <NOARP> mtu 1480 qdisc noop state DOWN 
    link/ipip 0.0.0.0 brd 0.0.0.0
6: gre0: <NOARP> mtu 1476 qdisc noop state DOWN 
    link/gre 0.0.0.0 brd 0.0.0.0
7: sit0: <NOARP> mtu 1480 qdisc noop state DOWN 
    link/sit 0.0.0.0 brd 0.0.0.0
8: ip6tnl0: <NOARP> mtu 1452 qdisc noop state DOWN 
    link/tunnel6 :: brd ::
9: ip6gre0: <NOARP> mtu 1448 qdisc noop state DOWN 
    link/[823] 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00


root@example1:/etc# ifconfig
eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  
          inet addr:123.456.789.55  Bcast:123.456.789.255  Mask:255.255.255.0
          inet6 addr: 1000:aaaa::aaaa:aaaa:aaaa:aaa/64 Scope:Global
          inet6 addr: fe80::aaaa:aaa:fffff:ffff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:66713 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54198 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7588512 (7.5 MB)  TX bytes:67678447 (67.6 MB)
          Interrupt:77 

eth0:0    Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  
          inet addr:192.168.150.8  Bcast:192.168.255.255  Mask:255.255.128.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:77 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:13579 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13579 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:852371 (852.3 KB)  TX bytes:852371 (852.3 KB)

root@example1:/etc# 

詳細は次のとおりです。

# ping -n 789.456.123.7
PING 789.456.123.7 (789.456.123.7) 56(84) bytes of data.
64 bytes from 789.456.123.7: icmp_req=1 ttl=63 time=2.46 ms
64 bytes from 789.456.123.7: icmp_req=2 ttl=63 time=1.80 ms
^C
--- 789.456.123.7 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.802/2.132/2.462/0.330 ms

ping -n 173.194.37.100 (NOTE: this is google.com)
PING 173.194.37.100 (173.194.37.100) 56(84) bytes of data.
64 bytes from 173.194.37.100: icmp_req=1 ttl=55 time=14.2 ms
64 bytes from 173.194.37.100: icmp_req=2 ttl=55 time=14.1 ms
64 bytes from 173.194.37.100: icmp_req=3 ttl=55 time=14.5 ms
^C
--- 173.194.37.100 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 14.188/14.325/14.513/0.168 ms

追加情報:

root@example1:/etc# dig google.com
; <<>> DiG 9.8.1-P1 <<>> google.com
;; global options: +cmd
;; connection timed out; no servers could be reached

root@example1:/etc# dig www.google.com @8.8.8.8
; <<>> DiG 9.8.1-P1 <<>> www.google.com @8.8.8.8
;; global options: +cmd
;; connection timed out; no servers could be reached

root@example1:/etc# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=51 time=1.05 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=51 time=1.08 ms
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.058/1.073/1.089/0.036 ms

root@example1:/etc# traceroute google.com
google.com: Temporary failure in name resolution
Cannot handle "host" cmdline arg `google.com' on position 1 (argc 1)

# 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

通常の方法でソフトウェアをインストールするためにUbuntuリポジトリに接続することはできませんでしたが、ローカルでnmapをダウンロードし、SCPを使用してdebパッケージをサーバーにコピーしました。

結果は次のとおりですnmap -sS -sU -p 53

Host is up (0.00085s latency).
PORT   STATE SERVICE
53/tcp open  domain
53/udp open  domain

ベストアンサー1

ファイアウォールの問題を検出するには、ファイアウォールをオフにするか、ポート53でUDPを許可するルールを追加します。ポート53のTCPも許可されます。構成の変更を制御し、すべての重要な構成ファイルのバックアップを維持します。

おすすめ記事