It depends on what you're using for the resolver.
I'm assuming you only care about gethostbyname(3) and friends. With glibc that means nss; generally you're also looking at libnss_dns.so, which uses glibc's resolv (copied from BIND). This doesn't include enough configuration to do what you suggest; it pretty much just points everything towards a server.
So you have two options: use a different NSS module (maybe write your own?) or have a proxy DNS resolver that sends different requests to different places.
systemd-resolved actually handles the first option pretty well (although it would prefer that you use the dbus interface over gai). It can handle multiple interfaces with separate domains and split DNS fairly well! (Not so good with reverse DNS, unfortunately. But I get it, reverse DNS is pretty hacky anyways.)
If you prefer the forwarder route, dnsmasq seems to be fairly popular these days in the embedded world and elsewhere.
If I were you, I think I'd write a short NSS module or use dnsmasq, depending upon your needs.
So you have two options: use a different NSS module (maybe write your own?) or have a proxy DNS resolver that sends different requests to different places.
systemd-resolved actually handles the first option pretty well (although it would prefer that you use the dbus interface over gai). It can handle multiple interfaces with separate domains and split DNS fairly well! (Not so good with reverse DNS, unfortunately. But I get it, reverse DNS is pretty hacky anyways.)
If you prefer the forwarder route, dnsmasq seems to be fairly popular these days in the embedded world and elsewhere.
If I were you, I think I'd write a short NSS module or use dnsmasq, depending upon your needs.