如何查看CentOS8的DNS地址?

如何查看CentOS8的DNS地址?

系统环境:阿里云Linux CentOS8.2 64位系统.

一.查看系统环境

[root@ityzm ~]# cat /etc/redhat-release 

CentOS Linux release 8.2.2004 (Core) 

二.查看dns服务器

[root@yzmedu ~]# cat /etc/resolv.conf

nameserver 100.100.2.136
nameserver 100.100.2.138

三.Linux系统下查看dns很简单了,或者nmcli也可以很容易查看

[root@ityzm ~]# nmcli device show eth0
GENERAL.DEVICE:                         eth0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         00:16:3E:0C:64:51
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     System eth0
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/1
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         172.31.184.230/20
IP4.GATEWAY:                            172.31.191.253
IP4.ROUTE[1]:                           dst = 0.0.0.0/0, nh = 172.31.191.253, mt = 100
IP4.ROUTE[2]:                           dst = 172.31.176.0/20, nh = 0.0.0.0, mt = 100
IP4.DNS[1]:                             100.100.2.136
IP4.DNS[2]:                             100.100.2.138
IP6.ADDRESS[1]:                         fe80::216:3eff:fe0c:6451/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = ff00::/8, nh = ::, mt = 256, table=255
IP6.ROUTE[2]:                           dst = fe80::/64, nh = ::, mt = 256
[root@ityzm ~]# 

可以看到此Linux服务器设置了两台DNS服务器,大家可自行更改!!!

1 COMMENT

云知梦_强哥

小技能,希望对大家有用.

发表评论

邮箱地址不会被公开。 必填项已用*标注

晋公网安备14010902000157号   晋ICP备14001940号-4