[iyunv@centostest ~]# tailf /var/log/messages
Nov 11 14:22:39 centostest puppet-agent[20214]: (/Stage[main]/Host/Host[zabbix.ewin.com]/host_aliases) defined 'host_aliases' as 'zabbix'
Nov 11 14:22:39 centostest puppet-agent[20214]: (/Stage[main]/Host/Host[ywzhou-pc.ewin.com]/ensure) created
Nov 11 14:22:39 centostest puppet-agent[20214]: (/Stage[main]/Host/Host[centostest.ewin.com]/ensure) created
Nov 11 14:22:39 centostest puppet-agent[20214]: (/Stage[main]/Host/Host[puppet.ewin.com]/host_aliases) defined 'host_aliases' as 'puppet'
Nov 11 14:22:40 centostest puppet-agent[20214]: Finished catalog run in 1.13 seconds
说明:对原有的记录进行修改,增加了别名记录,没有的就创建。 (3)客户端再次查看hosts文件
1
2
3
4
5
6
7
8
9
10
[iyunv@centostest ~]# cat /etc/hosts
# HEADER: This file was autogenerated at Tue Nov 11 14:22:39 +0800 2014
# HEADER: by puppet. While it can still be managed manually, it
# HEADER: is definitely not recommended.
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.188.1.103 zabbix.ewin.com zabbix
10.188.1.73 puppet.ewin.com puppet
10.188.1.172 ywzhou-pc.ewin.com ywzhou-pc
10.188.1.85 centostest.ewin.com centostest