From 22f7ceb695ae98a3c090c34e3489305de911c8d2 Mon Sep 17 00:00:00 2001
From: Michal Privoznik libvirt-guest
+ New libvirt-guest
nss module that translates libvirt
+ guest names into IP addresses
+
+ As of v3.0.0
release, libvirt offers two NSS modules
+ implementing two different methods of hostname translation. The first and
+ older method is implemented by libvirt
plugin and
+ basically looks up the hostname to IP address translation in DHCP server
+ records. Therefore this is dependent on hostname provided by guests. Thing
+ is, not all the guests out there provide one in DHCP transactions, or not
+ every sysadmin out there believes all the guests. Hence libvirt implements
+ second method in libvirt-guest
module which does libvirt guest
+ name to IP address translation (regardless of hostname set in the guest).
+
+ To enable either of the modules put their name into the
+ nsswitch.conf
file. For instance, to enable
+ libvirt-guest
module:
+
+$ cat /etc/nsswitch.conf +# /etc/nsswitch.conf: +hosts: files libvirt-guest dns +# ... ++
Or users can enable both at the same time:
++$ cat /etc/nsswitch.conf +# /etc/nsswitch.conf: +hosts: files libvirt libvirt-guest dns +# ... ++ +
+ This configuration will mean that if hostname is not found by the
+ libvirt
module (e.g. because a guest did not sent hostname
+ during DHCP transaction), the libvirt-guest
module is
+ consulted (and if the hostname matches libvirt guest name it will be
+ resolved).
+
@@ -100,15 +142,18 @@ hosts: files libvirt dns
libvirt
NSS module matches only hostnames provided by guest.
+ If the libvirt name and one advertised by guest differs, the latter is
+ matched. However, as of v3.0.0
there are two libvirt NSS modules
+ translating both hostnames provided by guest and libvirt guest names.
+ The following paragraph describes implementation limitation of the
+ libvirt
NSS module.
These limitation are result of libvirt's internal implementation. While
libvirt can report IP addresses regardless of their origin, a public API
must be used to obtain those. However, for the API a connection object is
@@ -134,8 +179,11 @@ virsh domifaddr --source lease $domain
- If there's no record for either of the aforementioned commands, it's very
- likely that NSS module won't find anything and vice versa.
+ If there's no record for either of the aforementioned commands, it's
+ very likely that NSS module won't find anything and vice versa.
+ As of v3.0.0
libvirt provides libvirt-guest
NSS
+ module that doesn't have this limitation. However, the statement is still
+ true for the libvirt
NSS module.