linux 配置dns

[code="java"]
# echo "202.106.195.68">/etc/resolv.conf
# cat /etc/resolv.conf
202.106.195.68
# echo "nameserver 202.106.195.68">/etc/resolv.conf
--設置dns
# cat /etc/resolv.conf
nameserver 202.106.195.68
# ping www.baidu.com
PING www.a.shifen.com (61.135.169.125) 56(84) bytes of data.
64 bytes from 61.135.169.125: icmp_seq=0 ttl=55 time=15.0 ms
64 bytes from 61.135.169.125: icmp_seq=1 ttl=55 time=16.4 ms

--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 15.095/15.775/16.455/0.680 ms, pipe 2
# service network restart--重啓network服務
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
# 202.106.195.68
[/code]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章