<div dir="ltr"><div>Not an answer, actually.</div><div><br></div><div>- <b>Avoid multiple matches</b>. As explained in the 'scenario description', that's not possible in this case, but moreover, there might be other scenarios where it wouldn't be possible either.</div><div><br></div><div>- <b>My point of view:   Each computer has a (dnsmasq) DNS entry, the entry gets in DNS by DHCP of dnsmasq</b>. What a computer is? the physical instance or the virtual one? the hardware or the software? This is the key to my scenario. And I totally agree with you: each computer should have one entry, the problem is the definition of 'each computer'.</div><div><br></div><div>So, regardless of your opinion about the scenario being logical, making sense of being valid/invalid, the question stands: is there any way to define precedences for potentially multiple matches?</div><div><br></div><div>Thanks.</div><div>Jesus M Diaz</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 20 Jun 2021 at 22:50, Geert Stappers via Dnsmasq-discuss <<a href="mailto:dnsmasq-discuss@lists.thekelleys.org.uk">dnsmasq-discuss@lists.thekelleys.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, Jun 20, 2021 at 08:58:59PM +0100, Jesus M Diaz wrote:<br>
> Hello,<br>
> <br>
> Let me explain the scenario:<br>
> <br>
> - I have a number of computers acquiring IP-address by DHCP and I have<br>
> dnsmasq configured with static leases for specific mac-addresses.<br>
> - I also have a couple of virtual computers for very specific purposes that<br>
> I run from a live Linux distro from a USB drive. Physically I can run them<br>
> on any of my 'physical' computers.<br>
> <br>
> Now the problem and questions:<br>
> <br>
> - I configured the virtual-usb computers to present themselves with<br>
> specific hostnames.<br>
<br>
OK<br>
<br>
> - I configured dnsmasq to assign an ip-address based on the hostname, and<br>
> it works fine ... *IF AND ONLY IF* I don't have a specific mac-address<br>
> based dhcp-host entry.<br>
<br>
OK<br>
<br>
<br>
> Apparently when I have more than one dhcp-host entries matching the DHCP<br>
> request, the mac-addr based one is the preferred one. I've tried<br>
> configuring it in different order but always the mac-addr based is the<br>
> chosen one.<br>
> <br>
> So, my question:<br>
> is there any way to set up the precedence of the dhcp-host entry<br>
<br>
Triggered by  "the dhcp-host entry", a snippet from manual page of dnsmasq:<br>
   dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][tag:<tag>][,<ipaddr>][,<hostname>]<br>
<br>
In other words: "the dhcp-host entry" has many many meanings.<br>
<br>
<br>
> in case more than one match the DHCP request?<br>
<br>
What avoiding the multiple matches?<br>
<br>
<br>
<br>
And what is the actual problem? As in:  Why the question?<br>
<br>
My point of view:<br>
  Each computer has a (dnsmasq) DNS entry,<br>
  the entry gets in DNS by DHCP of dnsmasq.<br>
<br>
<br>
<br>
Regards<br>
Geert Stappers<br>
<br>
ADA coin wallet address<br>
 DdzFFzCqrhsmqj9cvCvEcpq7D97cqSVmKKB8wEAzyAxYP76PwhFZBi1qyz9e38heFdQ2twPhmaWusS2XogsBgz5Mx7DYxtN4W9TnPEPW<br>
-- <br>
Silence is hard to parse<br>
<br>
_______________________________________________<br>
Dnsmasq-discuss mailing list<br>
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk" target="_blank">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
<a href="https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss</a><br>
</blockquote></div></div>