@eworm: There’s a difference whether queried name doesn’t exist at all (NXDOMAIN, i.e. there are no records for it of any type) or only records of requested type don’t exist (but records of other types do).
But otherwise you’re right, DoH behaviour is terribly inconsistent with non-DoH, and it’s not just support for FWD:
In previous RouterOS and in current RouterOS without DoH, when you add static record of any type, it in fact “blocks” all record types for the name. E.g. if has A/AAAA/TXT in public DNS and you add only static A for to router, then when you ask router for AAAA or TXT for , it will say there’s none (returns zero answers). To be honest, I never noticed this before and I’m not yet sure if it’s correct/wanted or not. But when you use DoH, it doesn’t happen anymore. When you add static A for , it overrides only type A. Queries for other types are forwarded to DoH resolver and you get the behaviour you’re seeing.
If the behaviour used by DoH is correct, then (aside from that it should be the same for both) you don’t need NXDOMAIN, but something like (one of):
/ip dns static add name=<name> type=AAAA address=<some special value indicating that there's no data>
/ip dns static add name=<name> type=AAAA no-data=yes
Better the latter, because it would be useful for all record types. Perhaps also special “type=ALL no-data=yes” as fallback.
And about regexps, I never liked them in DNS. So far they were avoidable, but not anymore, and I think it’s wrong decision. If I have local domain.tld, I want type=FWD to forward all subdomains, it’s the most common and logical use case. Same for type=NXDOMAIN, it should automatically cover all subdomains, because if “domain.tld” doesn’t exist, then “sub.domain.tld” can’t either.
I don’t think you want this. The nice thing about DNS is that it’s hierarchical and searches can be optimized, so even when you have many records, it can be very fast. That’s until you introduce non-DNS-like things like regexps, they ruin the simplicity, because it’s another layer that requires different processing. They are useful, but they should be and extra tool and all simple configs should be possible without them.