[Dnsmasq-discuss] query rewriting
Simon Kelley
simon at thekelleys.org.uk
Fri Dec 4 11:17:09 GMT 2009
Tom Metro wrote:
> Is there a dnsmasq directive similar to 'alias' that instead of
> rewriting IP addresses in the query reply, rewrites the domain in the
> query? So a query for foo.domain always results in a query for bar.domain?
>
> This is related to the idea of a CNAME, but the dnsmasq 'cname'
> directive is restricted to bar.domain being local. I'm looking for
> something that will work for domains that aren't locally controlled. The
> 'address' directive is also related, but the target needs to be a
> domain, or at least a cached lookup, and not a static IP.
>
> -Tom
>
There's no way to do that, and it would be very difficult to provide one
for the following reason. Dnsmasq doesn't store a query when it forwards
it: it keeps the minimum amount of information needed to recognise the
reply and send it back to the original requestor. If the domain was
re-written before forwarding, there would be no-way to restore the
original question before returning the answer. The original requestor
would therefore get an answer to a different question than the one it
asked, and ignore it.
Sorry.
Simon.
More information about the Dnsmasq-discuss
mailing list