<div dir="ltr">Hi,<div><br></div><div>I'm an occasional sysadmin and I was looking to setup a round-robin wildcard CNAME for a test project at home. I checked the dnsmasq docs and saw:</div><div><br></div><div><p style="font-family:"Times New Roman";font-size:medium"><b>--cname</b> as long as the record name is in the authoritative domain. If the target of the CNAME is unqualified, then it is qualified with the authoritative zone name. CNAME used in this way (only) may be wildcards, as in</p><p style="font-family:"Times New Roman";font-size:medium"></p><pre><b>cname=*.<a href="http://example.com">example.com</a>,<a href="http://default.example.com">default.example.com</a></b></pre><pre><b><br></b></pre><pre><font face="sans-serif" style="">I figured out that the A records would need to be added as /etc/hosts entries so I did so then added a couple of lines in my config to be authoritative for this one zone and create the CNAME:</font></pre><pre><font face="sans-serif" style=""><br></font></pre><pre><font face="sans-serif" style="">auth-zone=local,<a href="http://127.0.0.0/24,192.168.0.0/16,br-lan">127.0.0.0/24,192.168.0.0/16,br-lan</a>
cname=*.k8s.local,app.k8s.local
</font></pre><pre><font face="sans-serif" style="">This *should* have created a DNS record that responds to queries for "app2.k8s.local", "app3.k8s.local" etc. That does not happen, any request for sub-domains below k8s.local returns empty data.</font></pre><pre><font face="sans-serif" style="">Instead what I have is a record that responds to the *literal form* of "*.k8s.local"!!</font></pre><pre>$ dig *.k8s.local @<a href="http://192.168.0.2">192.168.0.2</a>
; <<>> DiG 9.11.3-1ubuntu1-Ubuntu <<>> *.k8s.local @<a href="http://192.168.1.1">192.168.1.1</a>
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41245
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;*.k8s.local. IN A
;; ANSWER SECTION:
*.k8s.local. 0 IN CNAME app.k8s.local.
app.k8s.local. 0 IN A 192.168.1.11
app.k8s.local. 0 IN A 192.168.1.12
app.k8s.local. 0 IN A 192.168.1.13
;; Query time: 2 msec
;; SERVER: 192.168.0.2#53(192.168.0.2)
;; WHEN: Tue May 29 22:49:01 BST 2018
;; MSG SIZE rcvd: 115<font face="sans-serif" style="">
</font></pre></div><div><font face="sans-serif" style="">That is not a wildcard entry! Any idea what happened? DNSmasq is 2.80test2 (current version from the OpenWRT repo).</font></div><div><font face="sans-serif" style=""><br></font></div><div><font face="sans-serif" style="">I realise that the address=/<a href="http://domain.com/1.1.1.1">domain.com/1.1.1.1</a> form could be used, but that doesn't help create a round-robin entry. How should a wildcard entry for multiple backing hosts be created?</font></div><div><font face="sans-serif" style=""><br></font></div><div><font face="sans-serif" style="">Thanks</font></div><div><font face="sans-serif" style="">Stephen</font></div></div>