[Dnsmasq-discuss] Does dnsmasq support cname within same domain?

Geert Stappers stappers at stappers.nl
Fri Mar 4 21:35:40 UTC 2022


On Fri, Mar 04, 2022 at 07:56:23PM +0100, Matus UHLAR - fantomas via Dnsmasq-discuss wrote:
> On 03.03.22 10:38, Frank Liu wrote:
> > On Thu, Mar 3, 2022 at 3:52 AM Matus UHLAR - fantomas wrote:
> > > this is strange, my dnsmasq.conf (2.85, debian 11) states:
> > > 
> > > # Provide an alias for a "local" DNS name. Note that this _only_ works
> > > # for targets which are names from DHCP or /etc/hosts. Give host
> > > # "bert" another name, bertrand
> > > #cname=bertand,bert
> 
> > Your config will work, because it is NOT from the same domain. The short
> > name "bertand" in your config is considered a top domain by itself, so you
> > can dig bertand. (ending dot), but you can't dig bertand.your.dhcp.domain.

Because  with only 'cname=bertand,bert' is dnsmasq
not aware of '.your.dhcp.domain'.
 

> > You will see the issue if you add the same domain in the cname config, eg:
> > cname=bertand.your.dhcp.domain,bert
> 
> 1. it's the default config from debian - I have not changed it.
>    (and it's commented out)
> 
> 2. it was already explained that the problem lies elsewhere, my e-mail was
> even reply to that explanation.
> 
> It looks like the CNAME doesn't work for dhcp-assigned names although it
> should according to the config snippet above.
> 
> however, one should first verify this.
> 
> 
> I avoid problems of this type by defining:
> - hostnames and IP addresses in /etc/hosts
> - hostnames and MAC addresses in /etc/ethers
> 
> so the hostnames exist all the time.

Yes providing (configuring)  hostnames plus IP-address
makes it possible to answer to  A queries.


Groeten
Geert Stappers
Still curious about the challenge that original poster is facing.
-- 
Silence is hard to parse



More information about the Dnsmasq-discuss mailing list