<div dir="ltr"><div>Yes adding an host record with an internal address cause dnsmasq to reply alternately the internal and external record to internal queries, useless, also --localise-queries has no effect.<br></div><div>Maybe the new flag should be called localise-auth-queries :-)<br></div><div>It would be a great small split-horizon for home networks :-)<br></div><b></b><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 6, 2015 at 11:33 PM, 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I can see exactly why it's behaving this way. The code attempts to<br>
answer directly queries from internal hosts for auth domains that would<br>
otherwise be forwarded, and then return to the authoritative side of<br>
dnsmasq. This is a performance hack.<br>
<br>
I don't think you ingenious use of address= was considered when that was<br>
done. It's not wrong, just - unexpected.<br>
<br>
If you add<br>
<br>
host-record=owncloud.local.lan,192.168.1.y<br>
<br>
then that record will be excluded from external queries, but allowed in<br>
internal queries. (I think - I've not tested this.) Internal queries<br>
will still get the external address too, so that may not be enough.<br>
<br>
I think that maybe a flag to turn off this performance hack might be the<br>
right answer.<br>
<br>
<br>
Simon.<br>
<span class=""><br>
<br>
<br>
<br>
On 06/06/15 09:59, Ermanno Scaglione wrote:<br>
> Hi to everybody, I use dnsmasq on my small home router (and find it great<br>
> btw), and I am attempting to use it also as an authoritative DNS for a<br>
> <a href="http://freedns.afraid.org" target="_blank">freedns.afraid.org</a> subdomain I host on my home server. I'd like to<br>
> configure the dns in a way that the domain resolves to address x.x.x.x when<br>
> queried over the external interface and to 192.168.1.y when queried over<br>
> the internal one, this because if I access the home server from inside the<br>
> lan using the external address x.x.x.x all traffic goes through the nat<br>
> layer of the small router and will slow down a lot. The home server is<br>
> running owncloud over a Gbit network so especially when up/downloading<br>
> large files it is important to access it using the internal address<br>
> 192.168.1.y.<br>
> Currently I have an auth-only dns listening only to the external interface<br>
> that resolves the domain owncloud.local.lan to x.x.x.x, dnsmasq is<br>
> listening on the bridge and the directive<br>
> address=/owncloud.local.lan/192.168.1.y<br>
> effectively creates the split-horizon since when internal hosts query the<br>
> dns for owncloud.local.lan get 192.168.1.y as answer and are able to access<br>
</span>> the home server at full switch speed while hosts qerying over the externaldhcp-host = fred, 192.168.0.3<br>
<span class="">> interface get x.x.x.x and I am able to access the home server from outside.<br>
> I had expected the same setup to work using the authoritative dns<br>
> capabilities of dnsmasq but it doesn't, if I put<br>
><br>
> auth-server=owncloud.local.lan,wan<br>
> host-record=owncloud.local.lan,x.x.x.x<br>
> auth-zone=owncloud.local.lanm,x.x.x.x/32<br>
> address=/owncloud.local.lan/192.168.1.y<br>
><br>
> also hosts inside the lan are answered x.x.x.x when querying for<br>
> owncloud.local.lan, it is like<br>
> the address directive is overriden by the auth-zone one. IMHO this is<br>
> wrong and address=// should<br>
> take precedence over auth-zone if the query comes from an interface<br>
> not listed in the auth-server<br>
> directive.<br>
><br>
> Maybe I just doing it wrong and there is a better way of doing it<br>
> ..... in that case please tell me.<br>
><br>
><br>
><br>
</span>> _______________________________________________<br>
> Dnsmasq-discuss mailing list<br>
> <a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
> <a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" target="_blank">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a><br>
><br>
<br>
<br>
_______________________________________________<br>
Dnsmasq-discuss mailing list<br>
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
<a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" target="_blank">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a><br>
</blockquote></div><br></div></div></div></div>