local dev environment with wildcard .test domains, served by dnsmaq on fedora 33/34

i am trying to set up an intel NUC with fedora 34 as my new stable local web development environment.

my environment on mac os x gets destroyed by system updates, even homebrew currently throws a lot of errors since last system update.

wanted is this:

  • nas with folder “sites” with a lot of web-projects in it, each in its own subfolder (checked, working)
  • fedora system with apache, mariadb, php, … (lamp) (checked, working)
  • sites/subfolder should be served by address subfolder.sites.test
  • would be nice if this worked from other computers within lan, too

on my mac is just needed to put two lines in dnsmasq.conf and resolve.conf to make this magic happen. virtualhost entry with wildcard serves all.

this is the mac config:

virtualhost-definition in httpd.conf or similiar:

<VirtualHost *:80>
ServerName sites.test
ServerAlias *.test
VirtualDocumentRoot “/Volumes/webroot/sites/%1/web”
UseCanonicalName Off

in /etc/resolver/test:

nameserver 127.0.0.1

in /usr/local/etc/dnsmasq.conf (through homebrew):

address=/.test/127.0.0.1

now on fedora (and other actual distros) there are things like NetworkManager and systemd-resolved which make things much more complicated.

i read a lot of samples all over the internet and tried them, without luck.

how to configure this with NetworkManager, systemd-resolved, dnsmaq etc. on fedora?

this article had the closest match, but still it does not work (or i am missing something)…

article: https://sixfeetup.com/blog/local-development-with-wildcard-dns-on-linux

is there someone here that made this work?

/frank