host.conf定义了解析器查询配置文件的顺序
root@zrools:~# cat /etc/host.conf
order hosts,bind #解析器查询顺序是文件/etc/hosts,然后是DNS
multi on #允许主机拥有多个ip地址
nospoof on #禁止ip地址欺骗
root@zrools:~# cat /etc/hosts
127.0.0.1 localhost
修改 /etc/hosts不生效请尝试:
- 重启网络服务或重启
- 检查/etc/host.conf配置
root@zrools:~# service networking restart