>> You need to configure things such that each nameserver listed in resolv.conf
>> can resolve all names you want resolved.

> This requirement feels impossible to meet; the dnsmasq spawned by libvirt
> on my laptop knows only the VMs running on my laptop. It is not possible
> for this dnsmasq to know the hosts on my LAN

That instance of dnsmasq, call it DV, provides services to VMs. If the
VMs are going to access the LAN or the Internet then DV needs to forward
DNS queries for which it isn't authoritative to a nameserver on the LAN
or on the Internet.

> I have a standard consumer router on my network to provide DHCP
> and dynamic DNS services. I do not want to require my laptop to be
> on and connected to my LAN for other hosts to continue using the LAN.

Agreed. Your laptop should ultimately send DNS queries to the nameserver
on the router, just as any other machine on the LAN does.

You want to be able to resolve VM names on your laptop as well as LAN
and Internet names. In that case you will have to use DV as your
laptop's nameserver and configure DV to forward DNS queries to the
router and not use the nameserver that the laptop is using (which is DV
itself — that would be a loop).

This should be implemented cleanly using resolvconf. Here is an outline
of how that should be done, blindly assuming a few things such as that
the "dnsmasq" package is not installed on your machine. I blindly
assume, that is, that libvirt runs an instance of dnsmasq using the
binary in the dnsmasq-base package.

Basically, DV should behave similarly to how the server instance of
dnsmasq (from the "dnsmasq" package) behaves with respect to resolvconf.

1. DV should register with resolvconf a loopback address at which it
listens.

Configure it to listen at 127.0.0.1 on the laptop and modify its control
script to run

    echo "nameserver 127.0.0.1" | resolvconf -a lo.dnsmasq

on start and

    resolvconf -d lo.dnsmasq

on stop.

2. DV should have a hook script in /etc/resolvconf/update.d/ which
generates a list of forwarders for DV to use.  The resolvconf hook
script from the dnsmasq package can be used verbatim for this purpose;
simply put the file in update.d/ and configure DV to use
/var/run/dnsmasq/resolv.conf as its only forwarders-list file.  If you
want details I can help you, or you can follow the good example of the
dnsmasq package.

** Summary changed:

- can't resolve lan hosts (regression)
+ Can't resolve both VM names and LAN names

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1163147

Title:
  Please run dnsmasq in such a way that it can also be used on the host
  — to look up the VMs' names

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1163147/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to