libvirt-nss is not for translating DNS names, rather than libvirt guest
names
I meant hostname/guest name. There is no static DNS in /etc/hosts for the VMs and no specific records in DNS server.
Can you see the guest in: /var/lib/libvirt/dnsmasq/virbr0.{macs,status}
# cat /var/lib/libvirt/dnsmasq/virbr0.{macs,status}
[
{
"domain": "KVM-Ubuntu-GNS3-Server-17.04",
"macs": [
"52:54:00:03:9f:9f"
]
}
]
[
{
"ip-address": "192.168.122.124",
"mac-address": "52:54:00:03:9f:9f",
"hostname": "KVM-Ubuntu-GNS3-Server-17",
"expiry-time": 1497617966
}
]
You need to restart the network after you've set up the NSS module.
I've rebooted the system.
I am using something along the lines of:
$ cat /etc/dnsmasq.d/libvirt.conf
server=/virt/192.168.213.1
server=/213.168.192.in-addr.arpa/192.168.213.1/
I have no /etc/dnsmasq.d/libvirt.conf, but in /etc/dnsmasq.conf:
I thought this would add that domain name to the answers from whatever is found in DHCP leases.
The comment says:
# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.
Since the first libvirt-nss module ("libvirt" plugin) looks into DHCP server leases, the above setting should work, shouldn't it?
Actually, I've just realized that there is a discrepancy between the libvirt VM guest name and the Ubuntu hostname, where the trailing ".04" has been automatically removed.
So, the hostname (not guest name) is accessible:
# ping KVM-Ubuntu-GNS3-Server-17
PING KVM-Ubuntu-GNS3-Server-17 (192.168.122.124) 56(84) bytes of data.
64 bytes from KVM-Ubuntu-GNS3-Server-17 (192.168.122.124): icmp_seq=1 ttl=64 time=0.191 ms
64 bytes from KVM-Ubuntu-GNS3-Server-17 (192.168.122.124): icmp_seq=2 ttl=64 time=0.302 ms
...
but not he FQDN: