在哪里更改 DNS,以便在重新启动后不会被覆盖?
# 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 103.241.42.2
nameserver 127.0.0.53
search xx
我不知道为什么,但上面的两个 dns 服务器都很糟糕..
# dig google.com @103.241.42.2; dig google.com @127.0.0.53; dig google.com @8.8.8.8
; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @103.241.42.2
;; global options: +cmd
;; connection timed out; no servers could be reached
; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @127.0.0.53
;; global options: +cmd
;; connection timed out; no servers could be reached
; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40430
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com. IN A
;; ANSWER SECTION:
google.com. 299 IN A 172.217.26.78
;; Query time: 15 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Jun 16 16:17:59 WIB 2017
;; MSG SIZE rcvd: 55
假设您将其添加到静态 IP
/etc/network/interfaces