<div dir="ltr"><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">Thanks for the explanation of REFUSED's meaning! I bet it's that the UDP sends are outright failing; I suspect that something is going wrong with the bind at program start. I'll take a look at the logs and report back on Monday.</pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><br></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">For now, though, I can pretty confidently say I'm not accidentally blocking the packets. All of my iptables rules are either for TCP, not for the interface that goes to the internet (eth0), or are matching UDP ports that these experiments aren't using.</pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><br></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">I used query-port=0, observed the unchanging source port of the (successful) resolutions, restarted dnsmasq with query-port=that_port - and got the error. Even if I was getting unlucky, and that attempt and my other attempts in the ephemeral range were failing because the port happened to be in use when dnsmasq tried to bind it, that shouldn't be the case for the lower numbered ports I was trying. (I'm not making any other changes in between these experiments, either, just changing query-port in dnsmasq.conf to commented, 0, or non-0, and then `service dnsmasq restart`.)</pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">> Just tried a simple test, and didn't see the same behaviour.
>
> Use log-queries to check that the process is really failing in dnsmasq,
> ie the problem is not REFUSED answers from upstream. A REFUSED answer
> from dnsmasq only occurs if either there are no possible upstream server
> to forward to, or if attempts to send UDP packets to all upstream
> servers fail immediately, at kernel level. You're not accidentally
> blocking packets from you special port, are you?
>
>
> Cheers,
>
> Simon.
>
>On 06/04/18 21:08, Fred Douglas wrote:
>><i> I would like dnsmasq to stick to a single source port for its requests,
</i>>><i> so that I can differentiate them from other DNS requests going out the
</i>>><i> same interface.
</i>>><i>
</i>>><i> The query-port option works as advertised when set to 0 (i.e. picks a
</i>>><i> single random port and sticks to it). Any other value, however - below
</i>>><i> 1024, a little above 1024, way up in the 50000s - causes dnsmasq to
</i>>><i> respond to all queries with a "REFUSED" (DNS error code 5).
</i>>><i>
</i>>><i> My dnsmasq.conf is empty other than query-port, and I haven't made any
</i>>><i> other weird changes to the system that should be relevant. This is
</i>>><i> Debian's current [2.76+whatever security patches] version of dnsmasq.
</i>>><i>
</i>>><i> Does anyone else get this behavior?
</i>>><i>
</i>>><i> Fred
</i>>><i>
</i>>><i>
</i>>><i> _______________________________________________
</i>>><i> Dnsmasq-discuss mailing list
</i>>><i> <a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss">Dnsmasq-discuss at lists.thekelleys.org.uk</a>
</i>>><i> <a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a>
</i>>></pre></div>