<div dir="ltr">Hi,<div><br></div><div>I had some issues with the DHCP entries not being included when I made the server authoritative for the .local domain, as I was populating .local from DHCP leases in dnsmasq also.</div><div><br></div><div>Is this configuration of authoritative + DHCP entries supposed to work?</div><div><br></div><div>thanks</div><div>Stephen</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, 2 Jun 2018 at 18:09 Simon Kelley <<a href="mailto:simon@thekelleys.org.uk">simon@thekelleys.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 29/05/18 23:11, Stephen Howell wrote:<br>
> Hi,<br>
> <br>
> I'm an occasional sysadmin and I was looking to setup a round-robin<br>
> wildcard CNAME for a test project at home. I checked the dnsmasq docs<br>
> and saw:<br>
> <br>
> *--cname* as long as the record name is in the authoritative domain. If<br>
> the target of the CNAME is unqualified, then it is qualified with the<br>
> authoritative zone name. CNAME used in this way (only) may be wildcards,<br>
> as in<br>
> <br>
> *cname=*.<a href="http://example.com" rel="noreferrer" target="_blank">example.com</a> <<a href="http://example.com" rel="noreferrer" target="_blank">http://example.com</a>>,<a href="http://default.example.com" rel="noreferrer" target="_blank">default.example.com</a><br>
> <<a href="http://default.example.com" rel="noreferrer" target="_blank">http://default.example.com</a>>*<br>
> <br>
> *<br>
> *<br>
> <br>
> I figured out that the A records would need to be added as /etc/hosts<br>
> entries so I did so then added a couple of lines in my config to be<br>
> authoritative for this one zone and create the CNAME:<br>
> <br>
> <br>
> auth-zone=local,<a href="http://127.0.0.0/24,192.168.0.0/16,br-lan" rel="noreferrer" target="_blank">127.0.0.0/24,192.168.0.0/16,br-lan</a><br>
> <<a href="http://127.0.0.0/24,192.168.0.0/16,br-lan" rel="noreferrer" target="_blank">http://127.0.0.0/24,192.168.0.0/16,br-lan</a>> cname=*.k8s.local,app.k8s.local<br>
> <br>
> This *should* have created a DNS record that responds to queries for<br>
> "app2.k8s.local", "app3.k8s.local" etc. That does not happen, any<br>
> request for sub-domains below k8s.local returns empty data.<br>
> <br>
> Instead what I have is a record that responds to the *literal form* of<br>
> "*.k8s.local"!!<br>
> <br>
> $ dig *.k8s.local @<a href="http://192.168.0.2" rel="noreferrer" target="_blank">192.168.0.2</a> <<a href="http://192.168.0.2" rel="noreferrer" target="_blank">http://192.168.0.2</a>><br>
> <br>
> ; <<>> DiG 9.11.3-1ubuntu1-Ubuntu <<>> *.k8s.local @<a href="http://192.168.1.1" rel="noreferrer" target="_blank">192.168.1.1</a> <<a href="http://192.168.1.1" rel="noreferrer" target="_blank">http://192.168.1.1</a>><br>
> ;; global options: +cmd<br>
> ;; Got answer:<br>
> ;; WARNING: .local is reserved for Multicast DNS<br>
> ;; You are currently testing what happens when an mDNS query is leaked to DNS<br>
> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41245<br>
> ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1<br>
> <br>
> ;; OPT PSEUDOSECTION:<br>
> ; EDNS: version: 0, flags:; udp: 4096<br>
> ;; QUESTION SECTION:<br>
> ;*.k8s.local. IN A<br>
> <br>
> ;; ANSWER SECTION:<br>
> *.k8s.local. 0 IN CNAME app.k8s.local.<br>
> app.k8s.local. 0 IN A 192.168.1.11<br>
> app.k8s.local. 0 IN A 192.168.1.12<br>
> app.k8s.local. 0 IN A 192.168.1.13<br>
> <br>
> ;; Query time: 2 msec<br>
> ;; SERVER: 192.168.0.2#53(192.168.0.2)<br>
> ;; WHEN: Tue May 29 22:49:01 BST 2018<br>
> ;; MSG SIZE rcvd: 115<br>
> <br>
> That is not a wildcard entry! Any idea what happened? DNSmasq is<br>
> 2.80test2 (current version from the OpenWRT repo).<br>
<br>
<br>
The query was for *.k8s.local, and that's what you got an answer for.<br>
That's quite correct. Try<br>
<br>
dig app.k8s.local @<a href="http://192.168.0.2" rel="noreferrer" target="_blank">192.168.0.2</a><br>
<br>
Note that running in authoritative mode is a little more complex than<br>
you've configured: you'll need and auth-server config line as well, for<br>
instance, and probably a glue record elsewhere in the DNS.<br>
<br>
<br>
Cheers,<br>
<br>
Simon.<br>
<br>
> <br>
> I realise that the address=/<a href="http://domain.com/1.1.1.1" rel="noreferrer" target="_blank">domain.com/1.1.1.1</a><br>
> <<a href="http://domain.com/1.1.1.1" rel="noreferrer" target="_blank">http://domain.com/1.1.1.1</a>> form could be used, but that doesn't help<br>
> create a round-robin entry. How should a wildcard entry for multiple<br>
> backing hosts be created?<br>
> <br>
> Thanks<br>
> Stephen<br>
> <br>
> <br>
> _______________________________________________<br>
> Dnsmasq-discuss mailing list<br>
> <a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk" target="_blank">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
> <a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a><br>
> <br>
<br>
<br>
_______________________________________________<br>
Dnsmasq-discuss mailing list<br>
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk" target="_blank">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
<a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a><br>
</blockquote></div>