Description
Steps to reproduce:
1. Join XenServer 7 host to a domain
2. Remove XenServer 7 host from a domain
3. Examine /etc/hosts
You'll see that the domain's hostname is incorrectly left in the /etc/hosts file, this can cause problems with various software and configurations, this should be removed when leaving a domain.
For example, host not on any domain:
127.0.0.1 s1-b9 localhost localhost.localdomain localhost4 localhost4.localdomain4
Host joined to domain:
127.0.0.1 s1-b9.my.cool.domain.com s1-b9 localhost localhost.localdomain localhost4 localhost4.localdomain4
Host removed from domain:
127.0.0.1 s1-b9.my.cool.domain.com s1-b9 localhost localhost.localdomain localhost4 localhost4.localdomain4