天天看点

linux查看本机IP、gateway、dns

ip: 

    ifconfig

gateway:

 # netstat -rn

kernel ip routing table

destination     gateway         genmask         flags   mss window irtt iface

172.16.44.0     0.0.0.0          255.255.255.0    u         0      0          0 vmnet8

172.16.10.0     0.0.0.0          255.255.255.0        u         0      0          0 vmnet1

172.16.0.0       0.0.0.0          255.255.252.0        u         0      0          0 eth0

169.254.0.0     0.0.0.0          255.255.0.0           u         0      0          0 eth0

0.0.0.0         172.16.0.254    0.0.0.0           ug        0      0          0 eth0

(以0.0.0.0开始的行的gateway是默认网关)

dns:

 # cat /etc/resolv.conf

search               localdomain

nameserver 172.16.0.250

继续阅读