Access KVM guest instance using machine name

To access KVM guest instance using machine name from host

  1. Install libvirt-nss

    # yum install libvirt-nss
    
  2. 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://libvirt.org/nss.html

https://lukas.zapletalovi.com/2017/10/definitive-solution-to-libvirt-guest-naming.html


© 2015-2020 tendant