<div dir="ltr">Sorry wrong Thread.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 14, 2017 at 10:48 AM, Reddeiah Raju Konduru <span dir="ltr"><<a href="mailto:raju39k@gmail.com" target="_blank">raju39k@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Simon,<div><br></div><div>Thanks for the DHCP Client-ID's patch.</div><div><br></div><div>- Raju</div><div><br></div><div><br></div><div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Tue, Feb 14, 2017 at 7:10 AM, Simon Kelley <span dir="ltr"><<a href="mailto:simon@thekelleys.org.uk" target="_blank">simon@thekelleys.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<br>
Albert's suggestions are good, and you can't reliably read the leases<br>
file - in gets modified by delete-and-rewrite, so if the timing is<br>
wrong, you'll see an incomplete write.<br>
<br>
DHCP script gets all the information needed to maintain a database<br>
equivalent to the leases file, using whatever engine you prefer.<br>
<br>
<br>
<br>
Cheers,<br>
<br>
Simon.<br>
<div><div class="m_9101744980946190318h5"><br>
<br>
On 12/02/17 05:53, Albert ARIBAUD wrote:<br>
> Hi Sam,<br>
><br>
> Le Sat, 11 Feb 2017 16:06:55 -0600 Sam Weber <<a href="mailto:samweber01@gmail.com" target="_blank">samweber01@gmail.com</a>><br>
> a écrit:<br>
><br>
>> In our system, when a change occurs to the DNS entries we want<br>
>> dnsmasq to respond to, we scan the directory of active entries<br>
>> and then grep the dhcp.leases file to see if the entry exists<br>
>> there.  If the entry is not found in the leases file, we omit it.<br>
>> Once the scan and check is completed, we write a new hosts file<br>
>> and then send SIGHUP to dnsmasq so it knows to read the new file.<br>
>> This works well most of the time.  Sometimes, however, a<br>
>> perfectly valid entry is not found in the dhcp.leases file so we<br>
>> incorrectly omit the entry from the dnsmasq hosts file.  We can<br>
>> see that the leases file gets written very often in our system,<br>
>> and we think that sometimes we must be reading the leases file<br>
>> whilst dnsmasq is writing it, resulting in our reading the file<br>
>> when a value of interest has not yet been written.  Is this idea<br>
>> of our sometimes reading an incomplete leases file a possibility?<br>
>> Is there a workaround other than reading the leases file several<br>
>> times?<br>
><br>
> Not sure I understand your problem right, so I'll rephrase it and<br>
> let you tell me if that's what you do and want to happen:<br>
><br>
> - you have a list of names associated with IP addresses;<br>
><br>
> - you want to filter this list, keeping only the entries where the<br>
> IP address is currently being leased;<br>
><br>
> - you want the filtered list to be used by dnsmasq in its name<br>
> resolution process.<br>
><br>
> - you want the list to be kept up to date with the current leases.<br>
><br>
> - IOW, you want DHCP clients that get an IP which appears in your<br>
> list one to be assigned the corresponding name in the DNS, and you<br>
> want the DNS to NOT map names in this list if the corresponding IP<br>
> is not leased right now.<br>
><br>
> Is that it?<br>
><br>
> If so, /maybe/ dhcp-script is what you need or at least can help<br>
> you detect when you need to run your update, as it would give you a<br>
> sign that the leases just changed.<br>
><br>
> But it seems to me what you are doing is not really different from<br>
> what dnsmasq already does (i.e. reflexting DHCP names into the DNS)<br>
> when the MAC-to-IP mapping is done with static leases and each<br>
> dhcp-host line specifies a name.<br>
><br>
> If this is indeed what you are doing, then maybe you can achieve<br>
> that with options dhcp-hostsfile and dhcp-ignore-names.<br>
><br>
> You'd use dhcp-hostsfile to point to your list written as a list<br>
> of dhcp-host options, minus the "dhcp-host=" prefix.<br>
><br>
> You'd specify dhcp-ignore-names to make sure no host can overrule<br>
> your list and choose its own name in its DHCP requests.<br>
><br>
> You would then only have to tell dnsmasq whenever your list changes<br>
> by sending it SIGHUP, but you would not have to care about DHCP<br>
> leases being granted or released, as that is automatically<br>
> reflected in the DNS part of dnsmasq.<br>
><br>
> HTH (again, IIUC)<br>
><br>
> Amicalement,<br>
><br>
</div></div>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2.0.22 (GNU/Linux)<br>
<br>
iQIcBAEBCAAGBQJYox3bAAoJEBXN2m<wbr>rhkTWiO7gP/0fTR+9xbNPupk1pDBbE<wbr>/Y90<br>
5XQ5/LnS++uqhfUYBL8UPzjqk+l1Pp<wbr>KKb3nvTlGGQ/Ul68UsZ968awQbvZQg<wbr>Fy0l<br>
5WxrLyzTHnKLKzksII2ZKOGjOZ/fvU<wbr>3+USHyPo6hgfKSQbCfV9+LyW3vYLBG<wbr>fFMW<br>
n84r6mCzeUSLTOAwzXk813x7z5suHa<wbr>Ns3Rhc0lxHUTI/Lim4Lvg9oJE6yKAP<wbr>3pqY<br>
YE7BhOvtIbGKx3JGrWoy6EyAvSzirc<wbr>i2b5Kol+gJ+rCi7TvTqUP5BdvLY0QL<wbr>YdbY<br>
BS7l4xxR8DWNJCrgwa+VMnEMeYIlSZ<wbr>9vlkWBnGiw++ksI0M4K9C3kWAmIM0/<wbr>Anfv<br>
fBNGtjV4SsOlpydBbuQmizkZQty3Ni<wbr>Wo1XqcGlPOS/0YVQhrLqyTBFmCbovL<wbr>s0LU<br>
v43Iqj2z01XcP+znD/FDlY41kgC3UH<wbr>JPKR/1RhL966Yz7ZkHyl9d4unV2B69<wbr>OLCE<br>
gjN3HahWa8j9RJ7Y8rXmJeUbN7UPnZ<wbr>WuWUwR0dgid6qUMfnlo3EQniBbbNQW<wbr>6Fso<br>
EpB9N2R2npTs3cTitAJiE536Y+0jv0<wbr>ICsX7GJUaWLxGGhqKmDxBQrF8V0sX1<wbr>pO2g<br>
5it7PWOY1cNONqG05QXlSsf83IMogO<wbr>PlajEok6vKcsUSg/oy38HqH29UiW/f<wbr>Or8N<br>
WSvLT3mkikRqFv9hkCXZ<br>
=Qo5a<br>
-----END PGP SIGNATURE-----<br>
<div class="m_9101744980946190318HOEnZb"><div class="m_9101744980946190318h5"><br>
______________________________<wbr>_________________<br>
Dnsmasq-discuss mailing list<br>
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk" target="_blank">Dnsmasq-discuss@lists.thekelle<wbr>ys.org.uk</a><br>
<a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">http://lists.thekelleys.org.uk<wbr>/mailman/listinfo/dnsmasq-disc<wbr>uss</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_9101744980946190318gmail_signature" data-smartmail="gmail_signature">Thanks & Regards,<br><br>Reddeiah Raju Konduru<br><a href="tel:+91%2080951%2033903" value="+918095133903" target="_blank">+918095133903</a><br></div>
</font></span></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Thanks & Regards,<br><br>Reddeiah Raju Konduru<br>+918095133903<br></div>
</div>