应用程序和浏览器无法解析 .co.il 主机名,但 dig/nslookup 可以

应用程序和浏览器无法解析 .co.il 主机名,但 dig/nslookup 可以

我一段时间以来遇到的一个奇怪的问题:

很多时候,虽然不是一直如此,当我启动我的 Ubuntu 17.04 机器时,我无法浏览以色列网站(我自己在以色列)。co.il TLD 中的任何主机名都无法被浏览器和其他应用程序(如 ping)解析,而 dig/nslookup 可以完美解析它们。

通常(但并非总是)解决问题的方法是将 Google DNS 服务器添加到 /etc/resolv.conf。
我昨天已将这些名称服务器添加到 /etc/resolvconf/resolv.conf.d/,这样我就不必每次都手动添加它们,但今天我启动了 Ubuntu,.co.il 域名无法解析。

一些可能感兴趣的命令和文件:

$ ping google.co.il
ping: google.co.il: Name or service not known

$ dig google.co.il

; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.co.il
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59430
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.co.il.          IN  A

;; ANSWER SECTION:
google.co.il.       299 IN  A   216.58.205.227

;; Query time: 78 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Aug 12 11:27:04 IDT 2017
;; MSG SIZE  rcvd: 57

$ 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
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 127.0.0.53  

$ 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
gshadow:        files

hosts:          files mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns
networks:       files

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

netgroup:       nis

$ systemd-resolve --status
Global
         DNS Servers: 8.8.8.8
                      8.8.4.4
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.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-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 2 (enp3s0)
      Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: yes
         DNS Servers: 10.0.0.138
          DNS Domain: Home

这会是什么呢?

谢谢。

相关内容