Re: Libvirt dnsmasq oddity
On Mon, 16 Jan 2023 08:29:52 +0100 john doe wrote: > Or use [1]. > > [1] https://libvirt.org/formatnetwork.html#network-namespaces Thanks. That appears to be working. Here's what I ended up with for my xml file. Note the added xml schema in the first line, and the three lines of dnsmasq:options. -- http://libvirt.org/schemas/network/dnsmasq/1.0; connections="1"> default 1a6bc021-b0bf-43e9-8555-b70d559776ec -- -- Does anybody read signatures any more? https://charlescurley.com https://charlescurley.com/blog/
Re: Libvirt dnsmasq oddity
On Mon, 16 Jan 2023 08:29:52 +0100 john doe wrote: > > Perhaps I should comment out one or both entries for hawk. > > > > Or use [1]. > > [1] https://libvirt.org/formatnetwork.html#network-namespaces Thank you. That and the dnsmasq option --no-hosts look like they will do what I want. I will try it later today. -- Does anybody read signatures any more? https://charlescurley.com https://charlescurley.com/blog/
Re: Libvirt dnsmasq oddity
On 1/16/23 05:02, Charles Curley wrote: On Sun, 15 Jan 2023 18:18:00 -0600 Nicholas Geovanis wrote: I would first want to find out why the samba server is doing that "sometimes" but not others. My first guess would be that you have a hostname identified somewhere that resolves to 2 different addresses, depending. And one or both may be defaulted addresses. Indeed. And you are correct, but not, I think, in the way you mean. On the network's DNS server, hawk (the samba server and host for the vms in question) resolves to an address on the internal network for the benefit of other computers on the network. But, thanks to /etc/hosts, on hawk it resolves to an address on the loopback interface. The problem appears to be that libvert's dnsmasq instance picks up the contents of /etc/hosts in order to serve them to the VMs, all well and good, except that it serves up the address of hawk as well. root@hawk:~# cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 hawk.localdomainhawk # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters root@hawk:~# I don't think I added those entries. I just checked a few other machines, including a vm I recently built, and they all show similar entries. Perhaps I should comment out one or both entries for hawk. Or use [1]. [1] https://libvirt.org/formatnetwork.html#network-namespaces -- John Doe
Re: Libvirt dnsmasq oddity
On Sun, 15 Jan 2023 18:18:00 -0600 Nicholas Geovanis wrote: > I would first want to find out why the samba server is doing that > "sometimes" but not others. > > My first guess would be that you have a hostname identified somewhere > that resolves to 2 different addresses, depending. And one or both > may be defaulted addresses. Indeed. And you are correct, but not, I think, in the way you mean. On the network's DNS server, hawk (the samba server and host for the vms in question) resolves to an address on the internal network for the benefit of other computers on the network. But, thanks to /etc/hosts, on hawk it resolves to an address on the loopback interface. The problem appears to be that libvert's dnsmasq instance picks up the contents of /etc/hosts in order to serve them to the VMs, all well and good, except that it serves up the address of hawk as well. root@hawk:~# cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 hawk.localdomainhawk # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters root@hawk:~# I don't think I added those entries. I just checked a few other machines, including a vm I recently built, and they all show similar entries. Perhaps I should comment out one or both entries for hawk. I think you meant some sort of inadvertent double definition of a host. I haven't made that mistake in a while. > But Charles you seem to be past those kinds of mistakes usually :-) Usually. Thank you. Alas, Murphy can strike us all. -- Does anybody read signatures any more? https://charlescurley.com https://charlescurley.com/blog/
Re: Libvirt dnsmasq oddity
On Tue, Jan 10, 2023, 12:10 PM Charles Curley < charlescur...@charlescurley.com> wrote: > I seem to have hit an oddity in how dnsmasq operates for libvirt. > > I have two host machines each with several guests. One of those is also > the local samba server. Guests on the non-samba server can resolve the > samba server's host name correctly, so far without fail. > > Guests on the samba server sometimes get the correct IP address for the > samba server, and other times get an IP address for the samba server of > 127.0.1.1. That is the IP address provided in the host's /etc/hosts. > > I have a workaround of hard coding the IP address in the fstab entry, > but that's tacky. Is there a better way to handle this? > I would first want to find out why the samba server is doing that "sometimes" but not others. My first guess would be that you have a hostname identified somewhere that resolves to 2 different addresses, depending. And one or both may be defaulted addresses. But Charles you seem to be past those kinds of mistakes usually :-) -- > Does anybody read signatures any more? > > https://charlescurley.com > https://charlescurley.com/blog/ > >
Re: Libvirt dnsmasq oddity
On 1/10/23 19:10, Charles Curley wrote: I seem to have hit an oddity in how dnsmasq operates for libvirt. I have two host machines each with several guests. One of those is also the local samba server. Guests on the non-samba server can resolve the samba server's host name correctly, so far without fail. Guests on the samba server sometimes get the correct IP address for the samba server, and other times get an IP address for the samba server of 127.0.1.1. That is the IP address provided in the host's /etc/hosts. I have a workaround of hard coding the IP address in the fstab entry, but that's tacky. Is there a better way to handle this? To me, it looks like it is more a libvirt mailing list question than a Debian -user mailing list question! ;^) -- John Doe
Libvirt dnsmasq oddity
I seem to have hit an oddity in how dnsmasq operates for libvirt. I have two host machines each with several guests. One of those is also the local samba server. Guests on the non-samba server can resolve the samba server's host name correctly, so far without fail. Guests on the samba server sometimes get the correct IP address for the samba server, and other times get an IP address for the samba server of 127.0.1.1. That is the IP address provided in the host's /etc/hosts. I have a workaround of hard coding the IP address in the fstab entry, but that's tacky. Is there a better way to handle this? -- Does anybody read signatures any more? https://charlescurley.com https://charlescurley.com/blog/