解决树莓派“Temporary failure in name resolution”错误

今天树莓派出现了一个小错误,导致树莓派无法上网,使用ping 提示错误,具体提示信息为

ping: www.lxx1.com: Temporary failure in name resolution

分析原因,是因为树莓派的DNS设置错误,导致树莓派无法解析域名,通过dig命令可以进一步确定问题

$ dig baidu.com; <<>> DiG 9.11.5-P4-5.1-Raspbian <<>> baidu.com;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 5401;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1;; OPT PSEUDOSECTION:; EDNS: version: 0, flags:; udp: 512;; QUESTION SECTION:;baidu.com.                     IN      A;; Query time: 154 msec;; SERVER: 127.0.0.1#53(127.0.0.1);; WHEN: Sun Mar 01 13:47:14 CST 2020;; MSG SIZE  rcvd: 38

可以看到,解析...

阅读全文