Community discussions

MikroTik App
 
DyadyaGenya
Member Candidate
Member Candidate
Topic Author
Posts: 220
Joined: Mon May 08, 2023 10:34 pm

DNS and mDNS name conflict

Mon Mar 25, 2024 6:14 pm

On my Mikrotik, I configured a DNS server for a local domain zone. Everything seems to be working well, devices respond by name. Naturally, they have no access to the Internet. There are also several Arduino boards running on my network, which I initially configured to use mDNS. Previously I had not accessed them by domain name, only by mDNS name. Now I have installed a QNAP NAS on the network, to which I have assigned a domain name. But he doesn't respond to him. Although it responded to the NETBIOS name and mDNS name. A name from a domain zone is only responded to if I disable the Bonjour service for it. I decided to double-check how the situation is with Arduino sensors. It turned out that they also do not respond to the domain name.
Then I installed the Ubuntu 22.04 server instead of miktrotik. He built a bridge on it, DHCP server, local DNS and included QNAP and Arduino sensors in its network. And they ping both by mDNS name and domain name.
What needs to be configured on Mikrotik so that when it is connected to the network, local network domain names and mDNS names work simultaneously?

Perhaps I need to provide some tests to confirm my situation.
By the way, I have RouterOS 7.10.2
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3509
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DNS and mDNS name conflict

Mon Mar 25, 2024 6:25 pm

Just adding a .local to a static DNS is not enough to enable it for mDNS (or specifically DNS-SD). Bonjour uses multicast (or SRV and PTR DNS record) to actually resolve ".local" names. On Mac (or Linux distro/Windows with Bonjour/mDNS resolver enabled), it wouldn't check the DNS servers for a .local address per RFC spec (https://datatracker.ietf.org/doc/html/rfc6762):
Any DNS query for a name ending with ".local." MUST be sent to the mDNS IPv4 link-local multicast address 224.0.0.251 (or its IPv6 equivalent FF02::FB).

And since Mikrotik's DNS server does not support static PTR records, you can NOT use the unicast version of mDNS, DNS-SD (https://datatracker.ietf.org/doc/html/rfc6763).

Note; Well, specifically, "home.arpa" (or custom), just not ".local", for unicast mDNS – since the domain part should not be used mDNS generally e.g. it has a name, mDNS will figure out if domain or .local
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3509
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DNS and mDNS name conflict

Mon Mar 25, 2024 6:45 pm

Add'l detail, if you using a custom domain & want it resolved by mDNS. You'll need to add specific records to the DNS server used by clients to say that "regular" domain is enabled for mDNS lookups. This older document explains more how to add the Mikrotik to another DNS server (since you cannot add the need records using Mikrotik's built-in one):
http://www.dns-sd.org/ServerStaticSetup.html
 
DyadyaGenya
Member Candidate
Member Candidate
Topic Author
Posts: 220
Joined: Mon May 08, 2023 10:34 pm

Re: DNS and mDNS name conflict

Mon Mar 25, 2024 6:49 pm

Just adding a .local to a static DNS is not enough to enable it for mDNS
I did not add ".local" in the domain zones of my local DNS server. This is configured on the Arduino device itself, and apparently on QNAP. In order for me to ping/address them by mDNS name, for example, sens.local, I need to raise the Bonjour service on my PC from which I will do this. I didn’t say that I want to configure these same names, like sens.local, in my local Mikrotik DNS server. I was going to configure different domain zones on it, such as .dom, .dom2, etc. Apparently I didn’t explain well that I want to be able to access both sensor.local and sensor.dom at the same time. After all, this happened on a regular Ubuntu.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3509
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DNS and mDNS name conflict

Mon Mar 25, 2024 7:07 pm

I guess I'm suggesting there may not be easy solution using Mikrotik DNS. Mikrotik has NO support for "discovery proxy" (https://www.rfc-editor.org/rfc/rfc8766.html) which resolve normal/unicast DNS queries into mDNS ones, which is kinda what you'd like in this case. No static DNS entries needed would be need if they did...

Since they don't support that. You'll need to add all the sensors as static entries in your DNS server & that should work if you want them to be resolve by name using regular DNS. The. ".local" works since that forces a mDNS lookup and Arduino responds via IP multicast, but it doesn't register itself anywhere. Additionally, Mikrotik does not create static DNS entries based on DHCP leases (which you can use a script to fix).

Perhaps add your non-local domain to the DNS search prefix (say ".dom2") in the DHCP server might work for your case if you want them to be fully-qualified. But with search prefix, a plain "sensor1" on an OS it will append the sensor1.dom2 to any lookups and should be found. And, if Bonjour/mDNS was installed on OS doing lookup, it should also perform the lookup via mDNS – but if there static that should win – unless you append ".local", in which mDNS should win.

One gotcha here... since mDNS is often not just about finding the IP, rather some apps/protocol will use mDNS service data (provided in mDNS/DNS-SD TXT records) too – the "-SD" stands for "service discovery". In which case, it may be finding the IP, but not the associated metadata for the device that be available via mDNS.
 
DyadyaGenya
Member Candidate
Member Candidate
Topic Author
Posts: 220
Joined: Mon May 08, 2023 10:34 pm

Re: DNS and mDNS name conflict

Mon Mar 25, 2024 11:37 pm

Additionally, Mikrotik does not create static DNS entries based on DHCP leases (which you can use a script to fix).
But what about the DNS names in my local DNS zone for other devices that do not have a configured mDNS name? I registered them in Mikrotik and can contact them by this name. They are transmitted via DHCP. Moreover, if I turn off the Bonjour service on QNAP, then I get the opportunity to ping/contact him by the name that I assigned to him on Mikrotik. That is, they are also supplied via DHCP. But I lose the ability to contact by mDNS name. Although on a regular Ubuntu I can simultaneously access/ping both by name from the domain zone of the Ubuntu DNS server and by the mDNS name.
You'll need to add all the sensors as static entries in your DNS server & that should work if you want them to be resolve by name using regular DNS.
That's exactly what I did. Added entries on Mikrotik like: qnap.dom, sens1.dom, sens2.dom
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: mohsen1993, sijiancha and 37 guests