Ubuntu16.04 DNS配置

添加DNS设置

vim /etc/resolv.conf
#在文件中添加两行并保存
nameserver 8.8.8.8
nameserver 8.8.4.4

 测试DNS配置

root@localhost:~# nslookup example.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	example.com
Address: 93.184.215.14
root@localhost:~# ping example.com
PING example.com (93.184.215.14) 56(84) bytes of data.
64 bytes from 93.184.215.14: icmp_seq=1 ttl=50 time=255 ms
64 bytes from 93.184.215.14: icmp_seq=2 ttl=50 time=254 ms

 可以正常ping通域名

posted @ 2024-08-16 17:45  xjournal  阅读(2)  评论(0编辑  收藏  举报