dnsmasq

How to configure wildcard subdomains for authoritative (auth) dnsmasq dns server?


I have compiled dnsmasq v2.76 including support for running its authoritative dns server (NOAUTH removed in the Makefile).

Wildcard subdomains with dnsmasq is possible for the caching part of the server.

I have tried:

  1. host-record=*.domain.tld,1.2.3.4
  2. host-record=.domain.tld,1.2.3.4
  3. host-record=domain.tld,1.2.3.4
  4. address=/domain.tld/1.2.3.4

None of them return the expected answer for www.domain.tld.

How to configure a wildcard A record for the authoritative side?


Solution

  • In the to be released dnsmasq version 2.77 there will be a wildcard option for CNAME records.

    That can be configured like these examples:

    cname=*.domain.tld,domain.tld
    cname=*.otherdomain.tld,host.even-another-domain.tld
    

    Since commit b637d7815da89b5fb04c27b1d9a361fe5b2622a0 Tue, 13 Dec 2016 18:44:11 +0200 there is support for CNAME wildcards. Commit 2.77test4 contains the latest addition to the wildcard code.