Get the App
SLTechnology News&Howtos  ›  Development  › 

How to take effect after modification of hosts file under Linux

Shulou Source: shulou.com Published: 2022-06-01 21:39:59 11月14日 Update

This article is to share with you about how to modify the hosts file under Linux to take effect. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The hosts configuration file is a relatively simple way to map host names to IP addresses. But this mapping is only the mapping of the local machine, that is, each machine is independent, all computers cannot access each other through Hostname, and a restart is required to take effect after modifying the hosts configuration file. CentOS

Modify the hosts file

Effective command after vim / etc/hosts modification is completed

/ etc/init.d/network restart # restart the network or / etc/init.d/net.eth0 restart # this is to restart the network card Ubuntu # restart the network command $sudo / etc/init.d/networking restart thank you for reading! On "how to modify the hosts file under Linux to take effect" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Tags: File content command method more article network configuration good practical host that is that is just name address that is article machine look. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Linux NVidia Shulou Information macOS