在Windows系统中,修改hosts文件后需要重启电脑才能生效,在Linux系统中,如果想要立即生效,需要使用root权限,才能修改/etc/hosts文件,在修改完/etc/hosts文件后,需要重启网络服务或重启系统,使修改生效 。