This previous article about bootstrapping a network with sexy explained in detail how to manage a network and how to configure it with cdist.

This article shows you what needs to be changed to support DNS resolution in addition to the configured DHCP service.


I am using dnsmasq on my router, which can act as a DNS and DHCP server. DNS A entries can be added to the configuration using the host-record command.

The change

Taking the previously net-ipv4 backend, the required change is very small:

-        line="dhcp-host=${mac},$ipv4a,$hostname"
-        echo "${line}" >> "${tmp}"
+        echo "dhcp-host=${mac},$ipv4a,$hostname" >> "${tmp}"
+        echo "host-record=$hostname,$fqdn,$ipv4a" >> "${tmp}"

Thanks to the modular configuration and the easiness of both sexy and cdist, this change and a call to sexy net-ipv4 apply --all is everything that is needed to make dnsmasq serve internal DNS names.

The result

What this article should show is that whatever you do in the backend, sexy is not affected at all and you can dramatically change whatever happens on sexy net-ipv4 apply --all.

You can browse the sexy database as well as the cdist configuration.