On Sun, Feb 06, 2022 at 04:02:40PM +0000, Ken Gillett wrote:
> On 4 Feb 2022, at 20:46, Ken Gillett wrote:
> > 
> > I have several CNAMEs set up in DNSmasq on my Mac server that I
> > thought were working. If I use the 'host' command to check a CNAME
> > e.g :-
> > 
> >     host thecname
> > 
> > it returns:-
> > 
> >     thecname is an alias for thetarget.
> >     thetarget has address xx.xx.xx.xxx 
> > 
> > So looks good, but…
> > 
> > I now realise that all is not well. If I instead:-
> > 
> >     ping thecname
> > 
> > it returns:-
> > 
> >     ping: cannot resolve thecname: Unknown host
> > 
> > Which is apparent nonsense as it has just resolved that exact CNAME.
> > The problem appears to be that the client Mac performing the query
> > adds the domain name, so DNSmasq needs to resolve thecname.thedomain
> > (which is not cofigured), as if I use:-
> > 
> >     ping thecname.
> > 
> > It works.
> > 
> > Previously I used MacOS Server's DNS (BIND) and a CNAME is listed as:-
> > 
> >     thecname IN  CNAME thetarget.thedomain.
> > 
> > Which works perfectly. However, if I try something similar in DNSmasq, it 
> > simply fails.
> > 
> > If instead I create the DNSmasq cname as:-
> > 
> >     cname=thecname.thedomain,thetarget
> > 
> >  That seems to work. But
> > 
> > Apart from being the inverse of how BIND configures CNAMEs, how can
> > I configure DNSmasq CNAMEs to work without having to add thedomain
> > to every cname in every CNAME record in DNSmasq? I don't like to
> > hard code things like that as it could change. Is there any way to
> > make DNSmasq deal with this appropriately?
> > 

Quote from https://dnsmasq.org/docs/dnsmasq-man.html

 --cname=<cname>,[<cname>,]<target>[,<TTL>]
     Return a CNAME record which indicates that <cname> is really
     <target>. There is a significant limitation on the target; it must
     be a DNS record which is known to dnsmasq and NOT a DNS record
     which comes from an upstream server. The cname must be unique,
     but it is permissible to have more than one cname pointing to the
     same target. Indeed it's possible to declare multiple cnames to a
     target in a single line, like so: --cname=cname1,cname2,target

     If the time-to-live is given, it overrides the default, which is
     zero or the value of --local-ttl. The value is a positive integer
     and gives the time-to-live in seconds.

> 
> Any help with the CNAME problem?
> 

Answering that as

} Could I please get some help with what I call  "the CNAME problem"?

In manual pages are square brackets used to indicate what is optional.
Optional meaning "can left out" so
 --cname=<cname>,[<cname>,]<target>[,<TTL>]
becomes
 --cname=<cname>,<target>
and that matches
} }     cname=thecname.thedomain,thetarget.thedomain

Back to the "the CNAME problem".
Please elaborate it.  ( Because I don't get the "problem". )


Groeten
Geert Stappers
-- 
Silence is hard to parse

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to