[Dnsmasq-discuss] HOSTS not applied to cannonical names

Dominik DL6ER dl6er at dl6er.de
Tue Jun 19 09:58:44 BST 2018


Dear mailing list members,

it appears like that dnsmasq does not check the cache for canonical names.

Assume the following situation: I defined "127.0.0.1 lb2.pi-hole.io" in
/etc/hosts

If I query this domain directly, i.e.

> $ dig lb2.pi-hole.net
>
> ;; ANSWER SECTION:
> lb2.pi-hole.io.         2       IN      A       127.0.0.1
>
then everything works as expected. However, if this domain happens to be
in a reply to a CNAME query, e.g.

> $ dig changes.pi-hole.net
>
> ;; ANSWER SECTION:
> changes.pi-hole.net.    3099    IN      CNAME   lb2.pi-hole.io.
> lb2.pi-hole.io.         85843   IN      A       45.76.128.97
>
then dnsmasq ignores my HOSTS file entry and hands out the true record.

I assume the issue here is that dnsmasq forwards "changes.pi-hole.net"
to the upstream server and receives the full reply (incl. the correct A
record of lb2.pi-hole.io) so there is no need to lookup this domain in
the cache.

Is this a bug or is it by design?

Best regards,
Dominik




More information about the Dnsmasq-discuss mailing list