<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px">libvirt-nss is not for translating DNS names, rather than libvirt guest</span><br style="font-size:12.8px"><span style="font-size:12.8px">names</span></blockquote><div><br></div><div>I meant hostname/guest name. There is no static DNS in /etc/hosts for the VMs and no specific records in DNS server.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px">Can you see the guest in: </span><span style="font-size:12.8px">/var/lib/libvirt/dnsmasq/</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">virbr0.{macs,status}</span><br></blockquote><div><br></div><div> # cat /var/lib/libvirt/dnsmasq/virbr0.{macs,status}</div><div>[</div><div>  {</div><div>    "domain": "KVM-Ubuntu-GNS3-Server-17.04",</div><div>    "macs": [</div><div>      "52:54:00:03:9f:9f"</div><div>    ]</div><div>  }</div><div>]</div><div>[</div><div>  {</div><div>    "ip-address": "192.168.122.124",</div><div>    "mac-address": "52:54:00:03:9f:9f",</div><div>    "hostname": "KVM-Ubuntu-GNS3-Server-17",</div><div>    "expiry-time": 1497617966</div><div>  }</div><div>]</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px">You need to restart the network after you've </span><span style="font-size:12.8px">set up the NSS module.</span></blockquote><div><br></div><div>I've rebooted the system.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I am using something along the lines of:</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> $ cat /etc/dnsmasq.d/libvirt.conf</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> server=/virt/<a href="http://192.168.213.1">192.168.213.1</a></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> server=/213.168.192.in-addr.arpa/<a href="http://192.168.213.1/">192.168.213.1/</a></blockquote><div><br></div><div>I have no /etc/dnsmasq.d/libvirt.conf, but in <b>/etc/dnsmasq.conf</b>:<br></div><div><div><b>local=/<a href="http://actionmystique.net/">actionmystique.net/</a></b></div></div><div><br></div><div>I thought this would add that domain name to the answers from whatever is found in DHCP leases.</div><div>The comment says:</div><div><div># Add local-only domains here, queries in these domains are answered</div><div># from /etc/hosts or DHCP only.</div></div><div>Since the first libvirt-nss module ("libvirt" plugin) looks into DHCP server leases, the above setting should work, shouldn't it?</div><div><br></div><div>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.</div><div>So, the<b> hostname (not guest name) is accessible</b>:</div><div><div># ping KVM-Ubuntu-GNS3-Server-17</div><div>PING KVM-Ubuntu-GNS3-Server-17 (192.168.122.124) 56(84) bytes of data.</div><div>64 bytes from KVM-Ubuntu-GNS3-Server-17 (192.168.122.124): icmp_seq=1 ttl=64 time=0.191 ms</div></div><div><div>64 bytes from KVM-Ubuntu-GNS3-Server-17 (192.168.122.124): icmp_seq=2 ttl=64 time=0.302 ms</div></div><div>...</div><div><b>but not he FQDN</b>:</div><div><div># ping <a href="http://KVM-Ubuntu-GNS3-Server-17.actionmystique.net">KVM-Ubuntu-GNS3-Server-17.actionmystique.net</a></div><div>ping: <a href="http://KVM-Ubuntu-GNS3-Server-17.actionmystique.net">KVM-Ubuntu-GNS3-Server-17.actionmystique.net</a>: Name or service not known</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 16, 2017 at 1:39 PM, Martin Kletzander <span dir="ltr"><<a href="mailto:mkletzan@redhat.com" target="_blank">mkletzan@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Jun 10, 2017 at 08:53:16PM +0200, jean-christophe manciot wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello everyone,<br>
<br>
I have multiple virtual networks defined on my Server:<br>
# virsh net-list --all<br>
Name                 State      Autostart     Persistent<br>
------------------------------<wbr>----------------------------<br>
default              active     yes           yes<br>
...<br>
virtual-mgt-5        active     yes           yes<br>
...<br>
<br>
</blockquote>
<br></span>
I am using something along the lines of:<br>
<br>
 $ cat /etc/dnsmasq.d/libvirt.conf<br>
 server=/virt/<a href="http://192.168.213.1" rel="noreferrer" target="_blank">192.168.213.1</a><br>
 server=/213.168.192.in-addr.a<wbr>rpa/<a href="http://192.168.213.1/" rel="noreferrer" target="_blank">192.168.213.1/</a><br>
<br>
And all guests have .virt in their hostname, so I'm at least able to use<br>
that.  That way guests are available by their names in the .virt<br>
domain.  You should be able to do that with your domain name as well.<br>
Let me know if that works for you or not.<br>
<br>
Have a nice day,<br>
Martin<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Jean-Christophe</div>
</div>