# Support wildcards in local DNS records

**URL:** <https://discourse.pi-hole.net/t/support-wildcards-in-local-dns-records/32098>\
**Category:** Feature Requests\
**Created:** [May 12, 2020, 8:41am UTC](https://discourse.pi-hole.net/t/support-wildcards-in-local-dns-records/32098 "2020-05-12T08:41:57Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [June 17, 2020, 11:04am UTC](https://discourse.pi-hole.net/t/support-wildcards-in-local-dns-records/32098/12 "2020-06-17T11:04:45Z")

</div>

> [@jimmcslim](#):
>
> It would be great if wildcard domains were supported in custom DNS

As your request correlates the terms _wildcard domains_ and _DNS_, let me just mention that using wildcards with DNS records is problematic.

> **(In case you are interested why, click for details).**
>
> On a conceptual level, allowing definition of wildcard records has the potential to compromise DNS as a delegated system (e.g. a zone that does wildcarding and delegates to a subzone could mess with lookup of DNS records for that delegated zone), potentially [breaking DNSSEC](https://www.rfc-editor.org/errata_search.php?rfc=4592).
> 
> On a more practical level, use of wildcards has long been standardised in [RFC 1034, sec 4.3.3](https://www.ietf.org/rfc/rfc1034.txt).  
> It is important to note that wildcards as defined in there differ significantly from what you'd normally expect. Specifically, it would match only for such domains where a DNS record does not already exist, e.g. `nextcloud.my.net` would not match `*.my.net` if a DNS record had already been defined for the former.  
> Ambiguity in RFC 1034 4.3.3 left room for interpretation which in turn led to different DNS servers implementing inconsistent different behaviour for wildcard records. Much later [RFC 4592](https://www.ietf.org/rfc/rfc4592.txt) (still a proposed standard) tried to address this, and today, quite a few DNS servers will allow you to ignore wildcard DNS records from external sources as configured.
> 
> * * *

But putting terminology aside:

> [@jimmcslim](#):
>
> so that a bunch of local services that are reverse proxied can be assigned as subdomains of a single domain

As **jfb** mentioned, you may be able to achieve what you want by supplying a line to a separate configuration file of Pi-hole's embedded _`dnsmasq`_ (e.g. `/etc/dnsmasq.d/42-reverse-proxied-subdomains.conf`):

```auto
address=/revproxy.my.lan/192.168.0.42

```

Note that this isn't exactly wildcarding, as it doesn't involve using wildcard characters at all, and perhaps more importantly, it does not allow a distinction between a domain and its subdomains, e.g. both `dig nextcloud.revproxy.my.lan` and `dig revproxy.my.lan`(!) will resolve to _`192.168.0.42`_.

When considering to expose this feature via Pi-hole's UI, you'd have to make sure a user understands this, as providing this at the wrong level may mess up your entire network with one click, resolving all hostnames to a single IP, potentially even cutting a user from accessing Pi-hole's UI to fix this.  
To prevent this, Pi-hole could also reject requests for a known local tld, but it may not be accurately aware of that in all circumstances.

Also, **DL6ER**'s remark on longer restarting behaviour and brief DNS outages fully applies here.

---

_[View the full topic](https://discourse.pi-hole.net/t/support-wildcards-in-local-dns-records/32098)._
