Create a folder named etc-dnsmasq.d alongside Pi-hole’s docker-compose.yml file.
Inside the etc-dnsmasq.d folder, create a file named wildcards.conf with the following content:
# wildcards.conf
#
# Support wildcards in local DNS records
# address=/.mydomain.com/192.168.31.22
address=/.yourdomain.com/your-IP-address
In Pi-hole’s docker-compose.yml, make sure you have:
environment:
# Instructs Pi-hole’s FTL service to use the custom dnsmasq.d directory
FTLCONF_misc_etc_dnsmasq_d: 'true'
volumes:
# Uncomment this if you want to persist custom dnsmasq config files.
# Not needed for most new Pi-hole v6 setups. If you’re upgrading from v5
# and have used this directory before, keep it enabled during the first
# v6 container start to allow for a complete migration, then you can remove it.
# Requires FTLCONF_misc_etc_dnsmasq_d: 'true'.
- './etc-dnsmasq.d:/etc/dnsmasq.d'
4.Finally, run: docker compose down && docker compose up -d
Just going came in to say, I've recently moved from dnsmasq to pihole, only to find that now none of my named docker applications (that had nicename.sub.domain.com but were on the same IP) resolve.
I don't understand why wildcards in local DNS records wouldn't be desired by the average user. Certainly I want it.
ok, well, I had already created a wildcard.conf in /etc/dnsmasq.d
Perhaps if using this folder is default behaviour in dnsmasq but not in pi-hole it would be a considerate idea to add a warning in the UI stating that there are files being ignored.
I did find the setting on /admin/settings/all , and it now works, so thanks for that.
Ignoring these files by default tries to circumvent conflicts which might prevent Pi-hole to start. Various operating system provided packages, like LXC, create files in this directory changing the listening behavior, limiting it to only certain interfaces or excluding other interfaces. Why we see these files on many many user systems, having them by default is undesirable. And just because we see them in a lot of systems, where users don't actually need or asked for them, I have the feeling that prominent warning made trigger a lot more question signs then not mentioning anything about it.
But it surely up and open for discussion @moderators if there should be a warning on the web interface when there are files in /etc/dnsmasq.d but misc.etc_dnsmasq_d = false .
I think adding a warning if there are files in this directory is a bad idea. Most users don't need these files and using them is considered an advanced configuration. A warning like this will create confusion for most of the users.
I think we can add a better text or warning to the documentation making clear misc.etc_dnsmasq_d needs to be enabled to load additional files.
I don't know if the web UI is the place for that sort of warning, but it seems to me that a short note during the install process if the files are detected would probably be appropriate. Just something simple that an existing configuration was noted and the files are being left in place but unused. It would be more suited to advanced users who setup those configurations themselves, without causing undue concern to those who have had files added from another source.
Well, okay, but mine was a replacement installation not an upgrade - I'd had dnsmasq on an LXC and decided that I'd run pihole on a standalone pi instead. DNSmasq had the wildcard for Traefic.
I had 2 manual rules and the wildcard. I moved them after I did the install but the wildcard didn't work.