Linux下查看網關地址和DNS地址

查看網關地址

route -n

ip route show

netstat -r

traceroute www.baidu.com 100
#第一行就是自己的網關

more /etc/network/interfaces #【Debian/Ubuntu Linux】

more /etc/sysconfig/network-scripts/ifcfg-eth0 #【Red Hat Linux】

查看DNS地址

cat /etc/resolv.conf

nslookup www.baidu.com

參考資料

http://blog.itpub.net/20674423/viewspace-1130322/
https://www.cnblogs.com/kerrycode/p/5407635.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章