After Centos Ubuntu modify the hosts file, (restart) the effective command

CentOS

Modify the hosts file

vim /etc/hosts

Commands effective after modification

/etc/init.d/network restart    # 重启网络

or

/etc/init.d/net.eth0 restart   # 这个就是重启网卡了

Ubuntu

# 重启网络命令

$sudo /etc/init.d/networking restart
Published 125 original articles · Like 260 · Visits 120,000+

Guess you like

Origin blog.csdn.net/weixin_44685869/article/details/105491454