Linux网络配置(DNS配置)

问题:找不到DNS域名服务器

#localhost ~]$ ping www.baidu.com
ping: unknown host www.baidu.com

解决办法:

1.切换到root用户下执行“vim /etc/resolv.conf”;

2.增加一行 "nameserver 192.168.XX.XX",可访问外网的DNS域名服务器IP,保存即可。

# Generated by NetworkManager
nameserver 192.168.XX.XX

结果:

#localhost ~]$ ping www.baidu.com
PING www.a.shifen.com (61.135.169.125) 56(84) bytes of data.
64 bytes from www.baidu.com (61.135.169.125): icmp_seq=1 ttl=128 time=3.68 ms



你可能感兴趣的:(linux,DNS,网络)