I faced a very similar issue (if not exactly the same) on Linux Mint 19 (Tara). I've managed to solve it by combining 3 different pieces of information.
It seems to all be related to recent changes with systemd-resolved.
First, yes I've needed to configure /etc/nsswitch.conf as you did and would expect. As long as dns comes before mdns you should be good. I ended with simply:
hosts: files dns myhostname
ref: https://unix.stackexchange.com/a/457172/271210
Prior to upgrading to this version of Mint, this is the only thing I needed to do. Now I also ended up making the below two other changes to get it working...
After that I've configured my search domain so systemd-resolved would work as I wanted. So I've edited the file /etc/systemd/resolved.conf, the Domains setting under the [resolve] section. In my case it ended up looking like:
[Resolve]
#DNS=
#FallbackDNS=
Domains=trilliant.local
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes
ref: https://askubuntu.com/a/1031271/872881
I've also changed the avahi configuration to something else ("mdns" if I remember correctly, but it doesn't matter). It shouldn't be required however from my understanding. Just adding for completeness.
But none of it worked until I've called the following:
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
ref: https://askubuntu.com/a/938703/872881
After calling this, everything started working perfectly and as expected!
So it's possible I didn't really need to change the /etc/systemd/resolved.conf file but I kept this change since it made sense and allows me to only type a machine's name, without the complete FQDN, for DNS resolution to work.
You can edit /etc/systemd/resolved.conf
and set the DNS to the locally running bind aka DNS Server via
[Resolve]
DNS=127.0.0.1
restart with
systemctl restart systemd-resolved.service
and when you dig (or lookup as explained above) you DO get (just) a www.example.com A record with a locally served DNS' zone files appropriate IP result but it doesn't display as much information as what you get if you append @127.0.0.1 or the resolv.conf has 127.0.0.1 ahead of 127.0.0.53
This is a partial answer sourced from the help in comments and should be retained and not deleted like all the other replies I added that were delete on the grounds they where not declared like this one as a valid/useful Answer or partial answers, but they probably where useful for certain situation.
In my case I'm doing DNSSEC etc. and need to see more substantial results like those from @127.0.0.1 or at least that was why I didn't put more clarity on it being correct in some cases. I was of course expecting the full response you get when the resolv.conf points directly to the DNS running on the system at 127.0.0.1 and not chained via 127.0.0.53 to the DHCP provided router gateway (typically).
[Also please note the meager comments are insufficient to show work with code blocks and results, hence the importance of not deleting the communities discussion on resolving these problems together. Please consider multiple user flags for deletion status.]
Best Answer
Add your domain name and IP address to
/etc/hosts
file. For example127.0.0.1 thisbit.example.com
Edit:
Add configure apache to proxy to your fake path
ProxyPass / http://localhost/~USER/FAKE.thisbit.example.com/
ProxyPassReverse / http://localhost/~USER/FAKE.thisbit.example.com/