DNS 在 ubuntu 22.04 上间歇性解析

DNS 在 ubuntu 22.04 上间歇性解析

昨天我的 Oracle 托管服务器(Cloudflare DNS)突然断网,取而代之的是 cloudflare “Origin is unreachable” 代码 523 页面

我花了很长时间寻找原因,但没有任何改变。大约六个小时后,它突然恢复了正常——没有发生任何明显的变化。

我更新了服务器,重新启动并让它不管用——第二天,同样的代码 523 又出现了。

从远程工作站,我可以 ping Oracle 发布的公共 IP 地址和主机名,但无法浏览该网站。

感谢任何指点

Chris 更新:发布此问题时,网站重新上线。如果情况与昨天类似,则不会上线太久。另一个更新:果然,第二天发生了同样的事情,然后进入了一段较长的稳定期。我不知道该检查哪些日志。


从云服务器本身的 SSH 终端发出的所有命令

知识产权

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP group default qlen 1000
    link/ether 02:00:17:00:f1:14 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.14/24 metric 100 brd 10.0.0.255 scope global enp0s3
       valid_lft forever preferred_lft forever
    inet6 fe80::17ff:fe00:f114/64 scope link
       valid_lft forever preferred_lft forever

知识产权

default via 10.0.0.1 dev enp0s3
default via 10.0.0.1 dev enp0s3 proto dhcp src 10.0.0.14 metric 100
10.0.0.0/24 dev enp0s3 proto kernel scope link src 10.0.0.14 metric 100
10.0.0.1 dev enp0s3 proto dhcp scope link src 10.0.0.14 metric 100
169.254.0.0/16 dev enp0s3 scope link
169.254.0.0/16 dev enp0s3 proto dhcp scope link src 10.0.0.14 metric 100
169.254.169.254 via 10.0.0.1 dev enp0s3 proto dhcp src 10.0.0.14 metric 100

邻居

10.0.0.1 dev enp0s3 lladdr 00:00:17:dd:02:9f REACHABLE

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_seq=1 ttl=120 time=1.77 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=120 time=1.81 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=120 time=1.82 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=120 time=1.77 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=120 time=1.75 ms

挖掘 google.com

; <<>> DiG 9.18.18-0ubuntu0.22.04.1-Ubuntu <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46497
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             82      IN      A       172.217.169.46

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Tue Nov 28 16:07:23 GMT 2023
;; MSG SIZE  rcvd: 55

**ls -l /etc/resolv.conf** 

lrwxrwxrwx 1 root root 39 Nov  6  2022 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

cat /run/systemd/resolve/stub-resolv.conf

nameserver 127.0.0.53
options edns0 trust-ad
search vcn10091839.oraclevcn.com

resolvectl

Global
       Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub

Link 2 (enp0s3)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 169.254.169.254
       DNS Servers: 169.254.169.254
        DNS Domain: vcn10091839.oraclevcn.com

systemctl status systemd-resolved

● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-11-28 15:41:58 GMT; 12min ago
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
   Main PID: 790 (systemd-resolve)
     Status: "Processing requests..."
      Tasks: 1 (limit: 21418)
     Memory: 11.2M
        CPU: 118ms
     CGroup: /system.slice/systemd-resolved.service
             └─790 /lib/systemd/systemd-resolved

Nov 28 15:41:58 instance-221210-1158 systemd[1]: Starting Network Name Resolution...
Nov 28 15:41:58 instance-221210-1158 systemd-resolved[790]: Positive Trust Anchors:
Nov 28 15:41:58 instance-221210-1158 systemd-resolved[790]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Nov 28 15:41:58 instance-221210-1158 systemd-resolved[790]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in->
Nov 28 15:41:58 instance-221210-1158 systemd-resolved[790]: Using system hostname 'instance-221210-1158'.
Nov 28 15:41:58 instance-221210-1158 systemd[1]: Started Network Name Resolution.

命令netstat -lntup

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:6081            0.0.0.0:*               LISTEN      941/varnishd
tcp        0      0 127.0.0.1:36257         0.0.0.0:*               LISTEN      941/varnishd
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      790/systemd-resolve
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      1278/nginx: master
tcp        0      0 127.0.0.1:17000         0.0.0.0:*               LISTEN      883/php-fpm: master
tcp        0      0 127.0.0.1:18000         0.0.0.0:*               LISTEN      888/php-fpm: master
tcp        0      0 127.0.0.1:18003         0.0.0.0:*               LISTEN      885/newrelic-infra
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      891/redis-server 12
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      5399/sshd: /usr/sbi
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      1655/proftpd: (acce
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      2422/master
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/init
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1278/nginx: master
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1278/nginx: master
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      1198/mariadbd
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      869/memcached
tcp        0      0 127.0.0.1:11000         0.0.0.0:*               LISTEN      873/php-fpm: master
tcp        0      0 127.0.0.1:12000         0.0.0.0:*               LISTEN      874/php-fpm: master
tcp        0      0 127.0.0.1:8787          0.0.0.0:*               LISTEN      844/php-fpm: master
tcp        0      0 127.0.0.1:8788          0.0.0.0:*               LISTEN      844/php-fpm: master
tcp        0      0 127.0.0.1:15000         0.0.0.0:*               LISTEN      881/php-fpm: master
tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN      1014/nginx: master
tcp        0      0 127.0.0.1:16000         0.0.0.0:*               LISTEN      882/php-fpm: master
tcp        0      0 127.0.0.1:16001         0.0.0.0:*               LISTEN      882/php-fpm: master
tcp        0      0 127.0.0.1:13000         0.0.0.0:*               LISTEN      875/php-fpm: master
tcp        0      0 127.0.0.1:14000         0.0.0.0:*               LISTEN      876/php-fpm: master
tcp6       0      0 :::6081                 :::*                    LISTEN      941/varnishd
tcp6       0      0 :::8080                 :::*                    LISTEN      1278/nginx: master
tcp6       0      0 ::1:6379                :::*                    LISTEN      891/redis-server 12
tcp6       0      0 :::22                   :::*                    LISTEN      5399/sshd: /usr/sbi
tcp6       0      0 :::25                   :::*                    LISTEN      2422/master
tcp6       0      0 :::111                  :::*                    LISTEN      1/init
tcp6       0      0 :::80                   :::*                    LISTEN      1278/nginx: master
tcp6       0      0 :::443                  :::*                    LISTEN      1278/nginx: master
tcp6       0      0 :::3306                 :::*                    LISTEN      1198/mariadbd
tcp6       0      0 :::30167                :::*                    LISTEN      894/kinsing
tcp6       0      0 :::8443                 :::*                    LISTEN      1014/nginx: master
udp        0      0 127.0.0.53:53           0.0.0.0:*                           790/systemd-resolve
udp        0      0 10.0.0.14:68            0.0.0.0:*                           788/systemd-network
udp        0      0 0.0.0.0:111             0.0.0.0:*                           1/init
udp        0      0 127.0.0.1:323           0.0.0.0:*                           915/chronyd
udp6       0      0 :::111                  :::*                                1/init
udp6       0      0 ::1:323                 :::*                                915/chronyd

挖@169.254.169.254 askubuntu.com

; <<>> DiG 9.18.18-0ubuntu0.22.04.1-Ubuntu <<>> @169.254.169.254 askubuntu.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48607
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1372
;; QUESTION SECTION:
;askubuntu.com.                 IN      A

;; ANSWER SECTION:
askubuntu.com.          187     IN      A       104.18.37.100
askubuntu.com.          187     IN      A       172.64.150.156

;; Query time: 0 msec
;; SERVER: 169.254.169.254#53(169.254.169.254) (UDP)
;; WHEN: Tue Nov 28 15:35:13 GMT 2023
;; MSG SIZE  rcvd: 74

sudo /sbin/service sshd 状态

● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-11-28 15:41:59 GMT; 1min 10s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 910 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
   Main PID: 993 (sshd)
      Tasks: 1 (limit: 21418)
     Memory: 4.6M
        CPU: 67ms
     CGroup: /system.slice/ssh.service
             └─993 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Nov 28 15:41:59 instance-221210-1158 systemd[1]: Starting OpenBSD Secure Shell server...
Nov 28 15:41:59 instance-221210-1158 sshd[993]: Server listening on 0.0.0.0 port 22.
Nov 28 15:41:59 instance-221210-1158 sshd[993]: Server listening on :: port 22.
Nov 28 15:41:59 instance-221210-1158 systemd[1]: Started OpenBSD Secure Shell server.
Nov 28 15:43:05 instance-221210-1158 sshd[2939]: Accepted publickey for xxxxxx from nn.nn.nn.nn port ppp ssh2: RSA SHA256:****************************************
Nov 28 15:43:05 instance-221210-1158 sshd[2939]: pam_unix(sshd:session): session opened for user ******(uid=1001) by (uid=0)

相关内容