IntraNET DNS problem

Our company has several sites and I would like to refer to each machine with a DNS name between the sites. Next to it because I don’t like to work much just uploading hostnames to a local DNS server. Of course, the sites are already communicating with each other at the ip level.
I don’t want to show internal domain names from the outside, i.e. for apple.a.example.com → 10.10.1.50 I don’t want a.example.com to be public.
For the sake of simplicity:

  • .a.example.com 10.10.1.0/24 default DNS server a.b.c.d
  • .b.example.com 10.10.2.0/24 default DNS server b.c.d.e
  • .c.example.com 10.10.2.0/24 default DNS server c.d.e.f
    these three sites are not featured and internal name resolution should work without the internet.
    There is a Mikrotik firewall everywhere and it is served by DNS as well

Does anyone have the idea to do it.

ui: Bocsánat az angolomért… tudom elég gyenge

It was just added to current RouterOS (6.47):

/ip dns static
add forward-to=a.b.c.d regexp="^(.+\\.)\?a\\.example\\.com\$" type=FWD
add forward-to=b.c.d.e regexp="^(.+\\.)\?b\\.example\\.com\$" type=FWD
add forward-to=c.d.e.f regexp="^(.+\\.)\?c\\.example\\.com\$" type=FWD
add forward-to=a.b.c.d regexp="^(.+\\.)\?1\\.10\\.10\\.in-addr\\.arpa\$" type=FWD
add forward-to=b.c.d.e regexp="^(.+\\.)\?3\\.10\\.10\\.in-addr\\.arpa\$" type=FWD
add forward-to=c.d.e.f regexp="^(.+\\.)\?2\\.10\\.10\\.in-addr\\.arpa\$" type=FWD

I don’t like that it can be done only with regular expressions, but oh well, better than nothing.