dnsmasq: failed to create listening socket - Address already in use
This document (000021783) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 15 SP6
Situation
A system that runs `named` and also hosts one or more libvirt virtual networks that use `dnsmasq` as a DHCP and DNS server. For example the default network provided by the libvirt-daemon-config-network package.
After upgrading `dnsmasq` to version 2.90 or newer, libvirt virtual networks using `dnsmasq` as a DNS server will fail to start with an "Address already in use" error. For example:
dnsmasq: failed to create listening socket for 192.168.122.1: Address already in use
Resolution
By default, `named` is configured to listen on all local IP addresses. When used in conjunction with libvirt virtual networks, it must be configured to skip addresses used by the virtual networks, allowing `dnsmasq` to listen on those addresses.
The `named` service supports the listen-on directive in /etc/named.conf, which can be used to exclude an address (192.168.122.1 in our example), or the entire network block used by virtual machines (e.g. 192.168.122.0/24 or even 192.168.0.0/16). The following examples illustrate these various levels of exclusion:
listen-on port 53 { !192.168.122.1; any; };
listen-on port 53 { !192.168.122.0/24; any; };
listen-on port 53 { !192.168.0.0/16; any; };
Cause
Older versions of `dnsmasq` silently ignored the listen failures, which could lead to confusing or incorrect behavior of name resolution for virtual machines. Version 2.90 now correctly reports an error when it fails to listen on specified addresses. The configuration of the `named` service must be adjusted to exclude addresses used by `dnsmasq`.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000021783
- Creation Date: 10-Apr-2025
- Modified Date:16-Apr-2025
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com