Using dnsmasq

As an experimental feature, it is possible to use dnsmasq instead of the ISC dhcpd server and TFTP server.

In order to keep the configuration manageable, the file /etc/dnsmasq.d/ww4-hosts.conf is created and must be included in the main dnsmasq.conf via the conf-dir=/etc/dnsmasq.d option.

Installation

Before the installation, make sure that dhcpd and tftp are disabled. You can do that with the commands:

systemctl disable --now dhcpd
systemctl disable --now tftp

Now you can install dnsmasq.

# Rocky Linux
dnf install dnsmasq

# SUSE
zypper install dnsmasq

After the installation, instruct warewulf to use dnsmasq as its dhcpd and tftp service. This is done in the server configuration file, typically at /etc/warewulf/warewulf.conf:

tftp:
  systemd name: dnsmasq
  overlays: dnsmasq,tftproot
dhcp:
  systemd name: dnsmasq
  overlays: dnsmasq

The configuration of dnsmasq often doesn’t need to be changed, as the default configuration includes all files with following pattern /etc/dnsmasq.d/*conf into its configuration. This configuration is created by the overlay templates dnsmasq:/etc/dnsmasq.d/ww4-hosts.conf.ww and dnsmasq:/etc/dnsmasq.d/ww4-listen.conf.ww.

With iPXE network boot, the dnsmasq overlay uses the 00:00 entry in the tftp:ipxe map to select the boot file for legacy BIOS PXE clients. The default file is undionly.kpxe.

Note

In certain distributions, such as Rocky Linux 9, dnsmasq is configured to listen locally via the interface=lo option by default. Replace this entry in /etc/dnsmasq.conf with the interface associated with your Warewulf network, or remove/comment out the interface option entirely to enable listening on all interfaces.

ww4-listen.conf sets a listen-address for the server’s ipaddr and ipaddr6. When ipaddr6 is set, it also sets interface= to the server interface that holds that address, because dnsmasq sends IPv6 router advertisements and answers DHCPv6 only on interfaces named this way. If no interface that is up holds ipaddr6 when wwctl configure runs, it falls back to interface=*, which serves every interface. Run wwctl configure again once the interface is up.

Once the Warewulf configuration has been updated, re-deploy the configuration and restart warewulfd.

wwctl configure --all
systemctl restart warewulfd.service