问题描述

VM12 pro中安装的ubuntu,在使用wgetping baidu、QQ等域名时出现以下问题:

  1. # wget www.baidu.com
  2. --2018-04-24 18:14:42-- http://www.baidu.com/
  3. Resolving www.baidu.com (www.baidu.com)... failed: Temporary failure in name resolution.
  4. wget: unable to resolve host address www.baidu.com
  5. # ping www.baidu.com
  6. ping: unknown host www.baidu.com
  7. # nslookup www.baidu.com
  8. ;; connection timed out; no servers could be reached

解决方法

在网络链接正常的情况下,查看DNS服务器是否设置,如果没有,建议搭建以下DNS服务:(据说谷歌的8.8.8.8和8.8.4.4在国内不稳定,修改DNS服务器设置只需要vim以下/etc/resolv.conf文件即可,修改即生效,不用重启)

  1. # cat /etc/resolv.conf
  2. nameserver 114.114.114.114
  3. nameserver 1.2.4.8

来源: https://blog.csdn.net/wangyh_0412/article/details/80074097