On 06.02.22 16:02, Ken Gillett via Dnsmasq-discuss wrote:
Any help with the CNAME problem?
On 4 Feb 2022, at 20:46, Ken Gillett via Dnsmasq-discuss <dnsmasq-discuss@lists.thekelleys.org.uk> 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
can you test again with "dig" ?
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.
that "host" and "ping" use different ways to resolve names. "ping" uses libc resolver library, while "host" uses DNS. So they can give different results.
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?
you can not - DNS records are transmitted fully qualified and appending domain name is local issue, it has nothing to do with DNS setup.
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?
-- Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/ Warning: I wish NOT to receive e-mail advertising to this address. Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu. It's now safe to throw off your computer. _______________________________________________ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss