## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1localhost 255.255.255.255broadcasthost ::1localhost # Added by Docker Desktop # To allow the same kube context to work on the host and the container: 127.0.0.1kubernetes.docker.internal # End of section
在 Windows 系统的 CMD 中,通过 ipconfig /all 来查看当前配置的 DNS 服务器 IP。
在 MacOS 系统的终端中,通过 cat /etc/resolv.conf 来查看当前配置的 DNS 服务器 IP。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
(base) ➜ ~ cat /etc/resolv.conf # # macOS Notice # # This file is not consulted for DNS hostname resolution, address # resolution, or the DNS query routing mechanism used by most # processes on this system. # # To view the DNS configuration used by this system, use: # scutil --dns # # SEE ALSO # dns-sd(1), scutil(8) # # This file is automatically generated. # nameserver 10.150.4.13 nameserver 10.103.4.10 nameserver 10.103.4.45
以我的Mac为例,我连接上 GTIIT 的校园网后,DHCP 会告诉我应该请求这三个本地 DNS 服务器。
; <<>> DiG 9.10.6 <<>> @10.150.4.13 +trace moodle.gtiit.edu.cn ; (1 server found) ;; global options: +cmd . 63554 IN NS b.root-servers.net. . 63554 IN NS a.root-servers.net. . 63554 IN NS c.root-servers.net. . 63554 IN NS j.root-servers.net. . 63554 IN NS m.root-servers.net. . 63554 IN NS h.root-servers.net. . 63554 IN NS l.root-servers.net. . 63554 IN NS d.root-servers.net. . 63554 IN NS f.root-servers.net. . 63554 IN NS g.root-servers.net. . 63554 IN NS k.root-servers.net. . 63554 IN NS e.root-servers.net. . 63554 IN NS i.root-servers.net. ;; Received 692 bytes from 10.150.4.13#53(10.150.4.13) in 71 ms
cn. 172800 IN NS a.dns.cn. cn. 172800 IN NS b.dns.cn. cn. 172800 IN NS c.dns.cn. cn. 172800 IN NS d.dns.cn. cn. 172800 IN NS e.dns.cn. cn. 172800 IN NS ns.cernet.net. cn. 86400 IN DS 57724 8 2 5D0423633EB24A499BE78AA22D1C0C9BA36218FF49FD95A4CDF1A4AD 97C67044 cn. 86400 IN RRSIG DS 8 1 86400 20230828050000 20230815040000 11019 . LGkYzH66K84M7FmNlTfzE5TetLECmWi+yW0Pl+uL2z0CJgcmuOqHqhtI HaIHuttDYDX996TYUvS/ER7JNcnZ3kX8hI5/UVKtK0cFTexcMHmaza/I 8JvsI8l44f1Lz0qq+XgCa73H9Zj5HqM8qttcfRtY2wcVXDyIgrFQ20hL TUpdL5H9KoJpJVE0xEkJDfVfxaHRgm1Y4sRYGZ0ky/3O899drI7wnjrt qMIxJFP9b18r4ubh7YX9cUjbzL027T/0HOADXk1pGZ8rDjrnrYjXttL9 6CE7liEVNnnEGGyavVN8eGtzI2y+fPl8gv7zjd2OIS6KnsZ80qzvAO+w ZxPP5g== ;; Received 646 bytes from 199.7.83.42#53(l.root-servers.net) in 64 ms
gtiit.edu.cn. 172800 IN NS ns1.service.edu.cn. gtiit.edu.cn. 172800 IN NS ns2.service.edu.cn. 70R541957QDDOQL3HNPDDTF75P3VV706.edu.cn. 21600 IN NSEC3 1 0 10 AFFF 70UK3LB5DE16L5VPVCL3KMP5J1K3UQ8A NS 70R541957QDDOQL3HNPDDTF75P3VV706.edu.cn. 21600 IN RRSIG NSEC3 8 3 21600 20230827040707 20230728035719 21204 edu.cn. C3+GMYA1YmJoLo8cRmCouEH5NzvKKgOmoSeNJ2uOwP47eO1zj9bntjT2 2QXJ9/1lE5Y7Iydyx//kFl2SNQd33d80KK7OQMuhQb2fdl9LnWEXprLb VX3htlltt8Ek9wq+vHc8YRFaTGXYJe5dO0Ocskxv7u0eeu1p0VvLlTSl X+0= ;; Received 422 bytes from 103.137.60.44#53(ns.cernet.net) in 63 ms
moodle.gtiit.edu.cn. 86400 IN A 116.6.38.28 gtiit.edu.cn. 86400 IN NS ns1.service.edu.cn. gtiit.edu.cn. 86400 IN NS ns2.service.edu.cn. ;; Received 114 bytes from 202.112.5.49#53(ns1.service.edu.cn) in 52 ms