<div dir="ltr">Hi Simon, thanks for taking a look at this.<div><br></div><div>I have checked again under Debian Sid with dnsmasq from the Git repo as of 2022-07-22.  The tl;dr is again I have reproduced this bug with both (1) address= and (2) host-record=.  But (3) dynamic-host= continues to work fine.<div><br></div><div>In more detail: </div><div><br></div><div>Everything below is exactly as tested, except for privacy I have censored/modified my DUID and private IPv4 range (not the IPv6 range however - I quickly created a new one for this).  Also, I don't know if you will receive this with rich formatting, but I have highlighted in <span style="background-color:rgb(255,153,0)">orange</span> all bits that I've censored/modified - just in case you think there may be some key difference I'm not showing (although I really doubt it!)</div><div><br></div><div>After each config change but before checking DNS, on my Windows test machine I have performed an <font face="monospace">ipconfig /release6</font> and <font face="monospace">ipconfig /renew6</font> - to ensure it's renewing the lease with dnsmasq.</div><div><br></div><div>(0) Full config used for testing:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">domain=<a href="http://example.org">example.org</a></font></div><div><font face="monospace">auth-zone=<a href="http://example.org">example.org</a></font></div><div><font face="monospace">auth-server=<a href="http://example.org">example.org</a>,</font></div><div><font face="monospace">dhcp-range=fd50::1000,fd50::ffff,64,1h</font></div><div><font face="monospace">dhcp-host=id:<span style="background-color:rgb(255,153,0)"><DUID></span>, [fd50::10], Computer1</font></div><div><font face="monospace">address=/<a href="http://Computer1.example.org/10.0.0.10">Computer1.example.org/10.0.0.10</a></font></div><div><font face="monospace">#host-record=<a href="http://Computer1.example.org">Computer1.example.org</a>,10.0.0.10</font></div><div><font face="monospace">#dynamic-host=<a href="http://Computer1.example.org">Computer1.example.org</a>, 10.0.0.10, eth0</font></div></blockquote><div><br></div><div>fd50::/64 is being advertised by a router on the network, with the Managed Address flag set.</div><div><br></div><div>(1) With config as in (0); DNS only provides IPv6 address / AAAA record.</div><div><br></div><div>Nslookup (Windows):</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">> nslookup <a href="http://Computer1.example.org">Computer1.example.org</a> 10.<span style="background-color:rgb(255,153,0)">0.0.1</span></font></div><div><font face="monospace">Server:  UnKnown</font></div><div><font face="monospace">Address:  10.<span style="background-color:rgb(255,153,0)">0.0.1</span><br><br>Name:    <a href="http://Computer1.example.org">Computer1.example.org</a><br>Address:  fd50::10</font></div></blockquote><div><br></div><div>Dig:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">$ dig @10.<span style="background-color:rgb(255,153,0)">0.0.1</span> +short <a href="http://Computer1.example.org">Computer1.example.org</a> A <a href="http://Computer1.example.org">Computer1.example.org</a> AAAA</font></div><div><font face="monospace">fd50::10</font></div></blockquote><div><br></div><div>(2) With config as in (0) but address commented, host-record uncommented; DNS only provides IPv6 address / AAAA record.</div><div><br></div><div>Nslookup (Windows):</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">> nslookup <a href="http://Computer1.example.org">Computer1.example.org</a> 10.<span style="background-color:rgb(255,153,0)">0.0.1</span></font></div><div><font face="monospace">Server:  UnKnown</font></div><div><font face="monospace">Address:  10.<span style="background-color:rgb(255,153,0)">0.0.1</span><br><br>Name:    <a href="http://Computer1.example.org">Computer1.example.org</a><br>Address:  fd50::10</font></div></blockquote><div><br></div><div>Dig:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">$ dig @10.<span style="background-color:rgb(255,153,0)">0.0.1</span> +short <a href="http://Computer1.example.org">Computer1.example.org</a> A <a href="http://Computer1.example.org">Computer1.example.org</a> AAAA</font></div><div><font face="monospace">fd50::10</font></div></blockquote><div><br></div><div>(3) With config as in (0) but address commented, dynamic-host uncommented; DNS provides both IPv4 address / A record and IPv6 address / AAAA record.</div><div><br></div><div>Nslookup (Windows):</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">> nslookup <a href="http://Computer1.example.org">Computer1.example.org</a> 10.<span style="background-color:rgb(255,153,0)">0.0.1</span></font></div><div><font face="monospace">Server:  UnKnown</font></div><div><font face="monospace">Address:  10.<span style="background-color:rgb(255,153,0)">0.0.1</span><br><br>Non-authoritative answer:<br>Name:    <a href="http://Computer1.example.org">Computer1.example.org</a><br>Addresses:  fd50::10<br>          10.<span style="background-color:rgb(255,153,0)">0.0.10</span></font></div></blockquote><div>Dig:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">$ dig @<span style="background-color:rgb(255,153,0)">10.0.0.1</span> +short <a href="http://Computer1.example.org">Computer1.example.org</a> A <a href="http://Computer1.example.org">Computer1.example.org</a> AAAA</font></div><div><font face="monospace">10.<span style="background-color:rgb(255,153,0)">0.0.10</span></font></div><div><font face="monospace">fd50::10</font></div></blockquote><div><br></div><div><br></div><div>Hope that's all helpful!</div><div><br></div><div>Kind regards,</div><div><br></div><div>ryt51V</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 23 Jul 2022 at 18:07, Simon Kelley <<a href="mailto:simon@thekelleys.org.uk">simon@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">This is a bug, for sure.<br>
<br>
I can see exactly why this would happen with<br>
<br>
address=/<a href="http://Computer1.example.org/10.0.0.10" rel="noreferrer" target="_blank">Computer1.example.org/10.0.0.10</a><br>
<br>
but not with<br>
<br>
host-record=<a href="http://Computer1.example.org" rel="noreferrer" target="_blank">Computer1.example.org</a>,10.0.0.10,3600<br>
<br>
Please could you recheck that you are seeing the problem with <br>
--host-record? If you are, I've gone down the wrong track, but if you're <br>
not, then the fix for this is fairly simple.<br>
<br>
<br>
Cheers,<br>
<br>
Simon.<br>
<br>
<br>
On 22/07/2022 20:37, ryt 51V wrote:<br>
> Hi,<br>
> <br>
> I am setting up dnsmasq as a local DHCPv6 server and DNS server.  (I am <br>
> keeping my existing DHCPv4 server running on a separate appliance).<br>
> <br>
> I am running into an issue in the following circumstances:<br>
> <br>
>   * auth-zone is enabled<br>
>   * For a given device, there is a dhcp-host entry with the device's<br>
>     DUID for an IPv6 address.<br>
>   * The device is successfully obtaining this IPv6 address.<br>
>   * There is an address or host-record entry for the same device's IPv4<br>
>     address.<br>
> <br>
> When querying the DNS server for the hostname, only the DHCPv6 IPv6 <br>
> address is provided, not the IPv4 address from the address or <br>
> host-record entry.<br>
> <br>
> This is problematic as I am trying to run a dual-stack network, and so <br>
> need both IPv4 and IPv6 addresses readily resolvable.  That said, I am <br>
> not in any immediate need of help as using dynamic-host instead of <br>
> address or host-record is a suitable workaround.  But it would be <br>
> helpful to find out whether I am missing some nuance in the <br>
> configuration, or whether this is a bug.<br>
> <br>
> In more detail: Consider the following dnsmasq configuration (private <br>
> details have of course been modified)<br>
> <br>
>     no-resolv<br>
>     domain=<a href="http://example.org" rel="noreferrer" target="_blank">example.org</a> <<a href="http://example.org" rel="noreferrer" target="_blank">http://example.org</a>><br>
>     #auth-zone=<a href="http://example.org" rel="noreferrer" target="_blank">example.org</a> <<a href="http://example.org" rel="noreferrer" target="_blank">http://example.org</a>><br>
>     #auth-server=<a href="http://server.example.org" rel="noreferrer" target="_blank">server.example.org</a> <<a href="http://server.example.org" rel="noreferrer" target="_blank">http://server.example.org</a>>,<br>
>     dhcp-range=fd00::1000,fd00::ffff,64,1h<br>
>     dhcp-host=id:00:00:00:01:23:45:67:89:AB:CD:EF:00:00:00, [fd00::10],<br>
>     Computer1<br>
>     address=/<a href="http://Computer1.example.org/10.0.0.10" rel="noreferrer" target="_blank">Computer1.example.org/10.0.0.10</a><br>
>     <<a href="http://Computer1.example.org/10.0.0.10" rel="noreferrer" target="_blank">http://Computer1.example.org/10.0.0.10</a>><br>
>     #host-record=<a href="http://Computer1.example.org" rel="noreferrer" target="_blank">Computer1.example.org</a><br>
>     <<a href="http://Computer1.example.org" rel="noreferrer" target="_blank">http://Computer1.example.org</a>>,10.0.0.10,3600<br>
>     #dynamic-host=<a href="http://Computer1.example.org" rel="noreferrer" target="_blank">Computer1.example.org</a> <<a href="http://Computer1.example.org" rel="noreferrer" target="_blank">http://Computer1.example.org</a>>,<br>
>     10.0.0.10,eth0<br>
> <br>
> <br>
> And assume:<br>
> <br>
>   * The server running dnsmasq has IPv4 10.0.0.1<br>
>   * Computer1 has IPv4 10.0.0.10 (either static, or obtained from a<br>
>     separate DHCPv4 server)<br>
>   * Computer1 is successfully obtaining its IPv6 lease for fd00::10 from<br>
>     dnsmasq<br>
> <br>
> <br>
> (1) In the state above, providing Computer1 has obtained its IPv6 lease <br>
> from dnsmasq, dnsmasq will provide both A and AAAA records for Computer1.<br>
> For example, using dig:<br>
> <br>
>     $ dig @<a href="http://10.0.0.1" rel="noreferrer" target="_blank">10.0.0.1</a> <<a href="http://10.0.0.1" rel="noreferrer" target="_blank">http://10.0.0.1</a>> +short <a href="http://Computer1.example.org" rel="noreferrer" target="_blank">Computer1.example.org</a><br>
>     <<a href="http://Computer1.example.org" rel="noreferrer" target="_blank">http://Computer1.example.org</a>> A <a href="http://Computer1.example.org" rel="noreferrer" target="_blank">Computer1.example.org</a><br>
>     <<a href="http://Computer1.example.org" rel="noreferrer" target="_blank">http://Computer1.example.org</a>> AAAA<br>
>     10.0.0.10<br>
>     fd00::10<br>
> <br>
> <br>
>  From my perspective this is expected behaviour.<br>
> <br>
> (2) Now if you uncomment the auth-zone and auth-server lines, a DNS <br>
> query will *only* provide an AAAA record for the IPv6 address, and no A <br>
> record for the IPv4 address.<br>
> Again, using dig:<br>
> <br>
>     $ dig @<a href="http://10.0.0.1" rel="noreferrer" target="_blank">10.0.0.1</a> <<a href="http://10.0.0.1" rel="noreferrer" target="_blank">http://10.0.0.1</a>> +short <a href="http://Computer1.example.org" rel="noreferrer" target="_blank">Computer1.example.org</a><br>
>     <<a href="http://Computer1.example.org" rel="noreferrer" target="_blank">http://Computer1.example.org</a>> A <a href="http://Computer1.example.org" rel="noreferrer" target="_blank">Computer1.example.org</a><br>
>     <<a href="http://Computer1.example.org" rel="noreferrer" target="_blank">http://Computer1.example.org</a>> AAAA<br>
>     fd00::10<br>
> <br>
> <br>
>  From my perspective this is unexpected behaviour.  The address line <br>
> with the IPv4 address is for the authoritative domain, so I am unsure <br>
> why it would not be included.<br>
> <br>
> (3) If you comment out the address line and uncomment the host-record <br>
> line, then DNS provides the same result as (2).<br>
> Again, this is unexpected behaviour.  The host-record line is for the <br>
> authoritative domain.<br>
> <br>
> (4) If you comment out the host-record line and uncomment the <br>
> dynamic-host line, then DNS provides the same result as (1).<br>
> This is expected behaviour and a suitable workaround to case (2)/(3).  <br>
> Although it is odd that it's inconsistent with address and host-record <br>
> behaviour.<br>
> <br>
> (5) I have also noticed that instead of using dig, one uses a Windows <br>
> nslookup, Windows will declare the response as non-authoritative for <br>
> case (4), but won't for case (2)/(3).  Additionally if you remove the <br>
> dhcp-range and dhcp-host entries, nslookup will receive the IPv4 address <br>
> but again it will be marked as non-authoritative.<br>
> <br>
>  From my perspective, the behaviour in (2)/(3) is not correct (nor (5), <br>
> though I don't think that will really affect me that much).  The <br>
> address/host-record entries are for the domain listed in auth-zone, and <br>
> so should be included as authoritative records.<br>
> Indeed the dnsmasq man page more explicitly suggests that (3) is <br>
> incorrect behaviour for host-record entries.  It says that the <br>
> authoritative zone is populated with "IPv4 and IPv6 addresses from <br>
> /etc/hosts (and --addn-hosts ) and --host-record and --interface-name <br>
> and ---dynamic-host provided the address falls into one of the subnets <br>
> specified in the --auth-zone."  (Explicitly adding a subnet to the <br>
> auth-zone line makes no difference to the above tests)<br>
> <br>
> I have tested this with the same results with the following OS and <br>
> dnsmasq versions:<br>
> <br>
>   * Raspberry Pi OS Bullseye - dnsmasq 2.85-1 from RPi OS Repo<br>
>   * Debian Bullseye - dnsmasq 2.85-1 from Debian Repo<br>
>   * Debian Sid - dnsmasq 2.86-1.1 from Debian Repo<br>
>   * Debain Sid - Latest dnsmasq from the Git repo as of 2022-07-22<br>
> <br>
> <br>
> Any help appreciated!<br>
> <br>
> Kind regards,<br>
> <br>
> ryt51v<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>
<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>