我有一台装有 Arch Linux (4.7.2-1-ARCH) 的 PC。 PC 使用 DHCP 获取其 IP,但使用我通过 systemd-resolved 配置的不同 DNS 服务器。当我对具有 CNAME 记录的域使用 dig 命令时,关联的 A 记录丢失。如果我使用 dig 并手动配置服务器,则 A 记录就在那里。知道为什么 systemd-resolved 会改变 dns 记录吗?
如果您需要任何其他信息,请告诉我。
这是我的网络(systemd-networkd)配置
[Match]
Name=ens18
[Network]
DNS=10.0.0.18
DHCP=ipv4
[DHCPv4]
UseHostname=false
UseDNS=false
解决.conf:
# This is a static resolv.conf file for connecting local clients to
# systemd-resolved via its DNS stub listener on 127.0.0.53.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
挖 api.pushbullet.com:
; <<>> DiG 9.10.4-P2 <<>> api.pushbullet.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59038
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;api.pushbullet.com. IN A
;; ANSWER SECTION:
api.pushbullet.com. 186 IN CNAME ghs-svc-https-c573.ghs-ssl.googlehosted.com.
;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Son Sep 11 01:17:57 CEST 2016
;; MSG SIZE rcvd: 101
; <<>> DiG 9.10.4-P2 <<>> api.pushbullet.com @10.0.0.18
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33081
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 13, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;api.pushbullet.com. IN A
;; ANSWER SECTION:
api.pushbullet.com. 184 IN CNAME ghs-svc-https-c573.ghs-ssl.googlehosted.com.
ghs-svc-https-c573.ghs-ssl.googlehosted.com. 282 IN A 72.14.247.65
;; AUTHORITY SECTION:
. 509182 IN NS j.root-servers.net.
. 509182 IN NS d.root-servers.net.
. 509182 IN NS a.root-servers.net.
. 509182 IN NS l.root-servers.net.
. 509182 IN NS g.root-servers.net.
. 509182 IN NS b.root-servers.net.
. 509182 IN NS m.root-servers.net.
. 509182 IN NS i.root-servers.net.
. 509182 IN NS f.root-servers.net.
. 509182 IN NS h.root-servers.net.
. 509182 IN NS e.root-servers.net.
. 509182 IN NS k.root-servers.net.
. 509182 IN NS c.root-servers.net.
;; Query time: 0 msec
;; SERVER: 10.0.0.18#53(10.0.0.18)
;; WHEN: Son Sep 11 01:17:59 CEST 2016
;; MSG SIZE rcvd: 328
答案1
dig 命令的输出不同,因为它是不同的命令。
$ dig api.pushbullet.com @127.0.0.1
;; QUESTION SECTION:
;api.pushbullet.com. IN A
;; ANSWER SECTION:
api.pushbullet.com. 12 IN CNAME ghs-svc-https-c573.ghs-ssl.googlehosted.com.
ghs-svc-https-c573.ghs-ssl.googlehosted.com. 300 IN A 72.14.247.65
;; AUTHORITY SECTION:
. 495764 IN NS g.root-servers.net.
. 495764 IN NS e.root-servers.net.
. 495764 IN NS l.root-servers.net.
. 495764 IN NS j.root-servers.net.
. 495764 IN NS i.root-servers.net.
. 495764 IN NS d.root-servers.net.
. 495764 IN NS a.root-servers.net.
. 495764 IN NS m.root-servers.net.
. 495764 IN NS k.root-servers.net.
. 495764 IN NS f.root-servers.net.
. 495764 IN NS b.root-servers.net.
. 495764 IN NS h.root-servers.net.
. 495764 IN NS c.root-servers.net.
;; Query time: 72 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Son Sep 11 12:23:11 CEST 2016
;; MSG SIZE rcvd: 328