[Dnsmasq-discuss] CNAME trouble with no AAAA
Simon Kelley
simon at thekelleys.org.uk
Fri Oct 18 13:52:51 BST 2019
On 18/10/2019 12:51, Simon Kelley wrote:
> On 18/10/2019 12:41, Simon Kelley wrote:
>
>> The obvious way is to provide an AAAA record for the "local names". The
>> problem with that is it has to be real, or timeouts and stuff will
>> happen, so those hosts need to be dual-stack.
>>
>> I can see a strong argument that a query for a name which is configured
>> as a CNAME in dnsmaq, but for a type which is not known to dnsmasq,
>> should return a NODATA reply.
>>
>> In fact I can't see a downside to that.
>>
>> Anybody else?
>>
>>
>> Simon.
>>
>
>
> very simple patch to do alter this behaviour.
>
> diff --git a/src/rfc1035.c b/src/rfc1035.c
> index 0344af7..720713d 100644
> --- a/src/rfc1035.c
> +++ b/src/rfc1035.c
> @@ -1711,7 +1711,9 @@ size_t answer_request(struct dns_header *header,
> char *limit, size_t qlen,
> {
> char *cname_target =
> cache_get_cname_target(crecp);
>
> - if (!dryrun)
> + ans = 1;
> +
> + if (!dryrun)
> {
> log_query(crecp->flags, name, NULL,
> record_source(crecp->uid));
> if (add_resource_record(header, limit,
> &trunc, nameoffset, &ansp,
>
>
>
That breaks CNAMEs cached from upstream. This doesn't
diff --git a/src/rfc1035.c b/src/rfc1035.c
index 0344af7..21be03b 100644
--- a/src/rfc1035.c
+++ b/src/rfc1035.c
@@ -1711,6 +1711,9 @@ size_t answer_request(struct dns_header *header,
char *limit, size_t qlen,
{
char *cname_target =
cache_get_cname_target(crecp);
+ if (crecp->flags & F_CONFIG)
+ ans = 1;
+
if (!dryrun)
{
log_query(crecp->flags, name, NULL,
record_source(crecp->uid));
Simon.
More information about the Dnsmasq-discuss
mailing list