[Dnsmasq-discuss] dhcp-host precedence

Simon Kelley simon at thekelleys.org.uk
Sun Jun 27 22:30:42 UTC 2021

On 20/06/2021 20:58, Jesus M Diaz wrote:
> Hello,
> Let me explain the scenario:
> - I have a number of computers acquiring IP-address by DHCP and I have
> dnsmasq configured with static leases for specific mac-addresses.
> - I also have a couple of virtual computers for very specific purposes
> that I run from a live Linux distro from a USB drive. Physically I can
> run them on any of my 'physical' computers.
> Now the problem and questions:
> - I configured the virtual-usb computers to present themselves with
> specific hostnames.
> - I configured dnsmasq to assign an ip-address based on the hostname,
> and it works fine ... /IF AND ONLY IF/ I don't have a specific
> mac-address based dhsp-host entry.
> Apparently when I have more than one dhcp-host entries matching the DHCP
> request, the mac-addr based one is the preferred one. I've tried
> configuring it in different order but always the mac-addr based is the
> chosen one.
> So, my question: is there any way to set up the precedence of the
> dhcp-host entry in case more than one match the DHCP request?

MAC addresses are matched before hostnames, as you say. However
client-IDs are matched before both, so the solution may be  to configure
the DHCP client in your VM to send a specific client-id, and put that in
the dhcp-host entry.


More information about the Dnsmasq-discuss mailing list