To access KVM guest instance using machine name from host
-
Install libvirt-nss
# yum install libvirt-nss
-
And enable the NSS module with two “libvirt” keywords:
Add below line to /etc/nsswitch.conf file
hosts: files libvirt libvirt_guest dns myhostname
References:
https://lukas.zapletalovi.com/2017/10/definitive-solution-to-libvirt-guest-naming.html