[Dnsmasq-discuss] How to NOT bind dnsmasq to lo?

Tim Tassonis stuff at decentral.ch
Wed Jul 10 19:55:36 UTC 2024


Hi all

I tried using dnsmasq as local resolver, which in general works fine.

However, I however would like to run a second instance of dnsmasq 
binding only to a tap0, for a virtual network (vde2) for some qemu 
virtual machines, and I can't seem to get that to work, as it always 
complains about 127.0.0.1 already being taken.

I tried:


DHCP_OPT="192.168.8.9,192.1688.8.99,255.255.255.0,192.168.8.255,8h"
dnsmasq --log-queries --user=dnsmasq \
         --dhcp-leasefile=/var/lib/misc/qemu-vde-dnsmasq.leases \
         --dhcp-range=$DHCP_RANGE \
         --listen-address=192.168.8.1 \
         --interface=tap0 --except-interface=lo \
         --domain=decentral.ch \
         --enable-tftp  \
         --dhcp-boot=/var/lib/qemu-vde/pxeboot/pxelinux.0 \
         --pid-file=/run/qemu-vde-dnsmasq.pid



This works fine, but only if the local dnsmasq is not started.

Otherwise, it will fail with:

dnsmasq: failed to create listening socket for 127.0.0.1: Address 
already in use

Any ideas?

Bye
Tim



More information about the Dnsmasq-discuss mailing list