Bonjour, also known as zero configuration networking, enables automatic discovery of computers, devices, and services on IP networks. Bonjour uses industry standard IP protocols to allow devices to automatically discover each other without the need to enter IP addresses or configure DNS servers. The HELIOS mDNS (multicast DNS) server implementation is based on the Apple Bonjour server. To provide a true zero configuration experience, Bonjour requires that devices implement three essential parts:
Allocate IP addresses without a DHCP server
Translate between names and addresses without a DNS server
Locate or advertise services without using a directory server
HELIOS mDNS fully implements part 2. and 3. The automatic IP address configuration of the HELIOS server is up to the operating system and networking environment. HELIOS mDNS uses the existing IP configuration.
mDNS uses IP UDP network packets to exchange information. mDNS is a joint effort by participants of the “IETF Zero Configuration Networking” (www.zeroconf.org) and “DNS Extensions” working groups (datatracker.ietf.org/wg/dnsext/charter/).
A good starting point is a simple comparison between mDNS and AppleTalk. Historically, AppleTalk handled zero configuration very well and is still being used. The goal of mDNS is to offer similar services based on standard IP networks. A standard AppleTalk entity registration looks like:
“lw8500” represents the device name, “LaserWriter” the type, and “HELIOS Support” the AppleTalk zone. A standard mDNS registration looks like:
lw8500_printer._tcp. local. 515 pdl=application/postscript
|Device name (
||Service name (
||Service type (
|–||IP port (
|–||TXT info (
|Routing||– (only local DNS multicasts)|
|Additional info||–||(TXT info)|
|Lookup tool||HELIOS “poll”||HELIOS “mdnstool”|
The mDNS service name for a given type represents this service on a host. A lookup allows querying the host name for a given service.
Computer host names are usually resolved by use of a local “hosts” file lookup table or when configured from a DNS server. Some DHCP servers, e.g. the HELIOS DHCP server, can automatically update a DNS server with the preferred computer name. Applications and system utilities, e.g. the “ping” command will resolve host names into an IP address.
Applications must use the mDNS client APIs to resolve
mDNS registered host names, e.g. “macbook.local” to the
corresponding IP address. HELIOS “mdnstool” allows mapping
the name into an IP address, e.g.
Apple’s host resolving will automatically resolve host names via both DNS and mDNS.
When Apple’s Bonjour installer package (not the HELIOS mDNS installation!) is installed on Windows, an included Apple Bonjour NameSpace Provider (mdnsNSP) will resolve host names via both DNS and mDNS.
The deployment of mDNS in a local network needs zero configuration to find its services. In this case all mDNS registered names are in the “local” mDNS domain. For wide area network names the existing DNS servers must be updated manually to handle the name resolving.
Apple Bonjour adds capabilities (“Wide Area Bonjour”) to register its names with an existing DNS server. This requires additional configuration and a trusted DNS server. At present, the HELIOS mDNS server does not support “Wide Area Bonjour”.
On Mac OS X, HELIOS services will not include the HELIOS mDNS server. The existing Apple mDNS server “mDNSResponder” is used instead. All HELIOS services and tools are compatible with the Apple Bonjour server.
On Windows, the HELIOS mDNS server will check whether the Apple Bonjour Server for Windows is running and, if yes, use it. If the Bonjour Server is not running the HELIOS mDNS server will be used instead. If HELIOS services are installed on Windows it is recommended to use the HELIOS mDNS server because support is provided via HELIOS and its partners.
The HELIOS mDNS server is part of the HELIOS Base product and implements the multicast DNS protocol, which is called “Bonjour” by Apple. The HELIOS mDNS server supports all network interfaces with a valid IPv4 network interface. All IPv4 activated network interfaces are detected by default and used by the HELIOS mDNS server. Basically, no configuration is needed.
The HELIOS mDNS server is called “mdnssrv” and it is started by the HELIOS Service Controller (see 14 “The HELIOS Service Controller”).
The default mDNS server name is adapted from the server’s host name. If a different name is required the “mdnssrv” preference hostname (see 19.8 “mDNS server preference keys”) allows specifying a custom host name for mDNS.
The HELIOS network interface tool “ifstat” (see 8.8 “ifstat”) lists all available network interfaces with their names, e.g.:
If a setting of the HELIOS mDNS server is changed the service must be restarted, to adopt the new settings:
# srvutil stop -f mdnssrv # srvutil start mdnssrv
An automatic reconfiguration of the HELIOS mDNS server is not implemented because server environments are expected to be static and should not change automatically compared with mobile computers where an automatic configuration change is a great feature.
The HELIOS mDNS server uses the (UDP) IP port 5353, the mDNS Windows (TCP) IP port is 5354 (loopback only!).
mDNS local library communication requires the following resources:
|Mac OS X||/var/run/mDNSResponder|
|Windows||TCP port 5354 (loopback only)|
Registration types used by HELIOS:
|afpsrv||_afpovertcp._tcp and _adisk._tcp|
|dhcpsrv||_bootps._udp and _telnet._tcp|
The HELIOS mDNS proxy server ( “mdnsproxysrv”) forwards requests between network interfaces, and so allows connecting devices on different subnets, which would otherwise not “see” each other. HELIOS mDNS proxy also allows …
… mapping mDNS host names to remote IP addresses
… registering non-Bonjour devices (printers, websites, etc.)
… easy mDNS registrations for third-party applications via the mDNS telnet service port
… synchronizing static registrations from primary server via the mDNS remote server port
All HELIOS applications will automatically reconnect and re-register their mDNS services if an mDNS server should abort. The reconnect will be done every 10 seconds within the first minute, and later on every minute until the mDNS server is available again. This works also if the Apple Bonjour server is used.
Network tracers like “Wireshark” can decode the mDNS protocol.
HELIOS “mdnstool” is a network diagnostic tool, which allows browsing for registrations and registering names. It resembles Apple’s Mac OS X “dns-sd” (“Bonjour”) tool and can be used on all HELIOS supported platforms. Most of its functionality is not implemented in the binary itself, but in library code that is available to any application.
-E (Enumerate recommended registration domains) -F (Enumerate recommended browsing domains) -B <Type> <Domain> (Browse for services instances) -L <Name> <Type> <Domain> (Look up a service instance) -C <Type> <Domain> (complete Browse with IP-Address) -R <Name> <Type> <Domain> <Port> [<TXT>...] (Register a service) -P <Name> <Type> <Domain> <Port> <Host> <IP> [<TXT>...] (Proxy) -Q <FQDN> <rrtype> <rrclass> (Generic query for any record type) -I (Test registering and then immediately updating TXT record) -H <Host> <IP> (Register a host record for an unknown host) -h (Help and documentation)
If “mdnstool” is called without options, a brief usage info is issued.
Enumerate recommended registration domains
Enumerate recommended browsing domains
Browse for service instances To find a list of all services use the type “_services._dns-sd._udp”
Look up a service instance
Browse with port and IP address
Register a service
Get the IP address of an mDNS host name
Test registering and then immediately updating TXT record
Set time limit for calls
Register a host record for an unknown host
Display help text
May be arbitrary Unicode text (UTF-8), containing any legal unicode characters (including dots, spaces, slashes, colons, etc. without restriction), up to 63 bytes long
Form: “_app-proto._tcp” or “_app-proto._udp”, where “app-proto” is a registered application protocol name
Domain in which to register the service. In current implementations, only the local multicast domain “local” is supported
Number from 0 to 65535. The TCP or UDP port number upon which the service is listening
Host name of the mDNS client, e.g. “macbook.local.”
IP address that the HELIOS mDNS server delivers upon request
These additional parameters must be – if specified – the first argument:
(No auto rename of duplicate registrations)
In combination with registering a service, duplicate names will not be renamed into a number suffix. Instead an error will be reported
(Loopback interface only)
By default registrations and lookups are performed using all configured network interfaces. The
allows limiting the operation on the loopback interface only.
(Numbered interface only)
-p option allows limiting the operation on a
specified interface only, e.g.
Time when service was last refreshed.
Add or remove services. During a short request, there are probably only “Add” messages. However, if running the tool for a longer time, when services disappear, also “remove” (“Rmv”) messages will be shown.
Internally used flag field with the content:
||A service has been added.|
||Additional messages in the|
||A combination of both flags.|
Internally used ID of the interface via which a message came in.
local for mDNS messages; on DNS queries this
might also be any other domain, e.g.
Type description of the reported service.
Actual type and class. A query does not just request service messages but also internal server data. Service types as well as the classes are listed in the library file “libmdns.h”.
The type is required:
kDNSServiceType_A = 1
and the class:
kDNSServiceClass_IN = 1
Data received as a result of the query, e.g. the IP address of the queried server name.
Register the printer “testreg” on the standard “lpd” port (515) to the local Bonjour/mDNS domain. This registration is valid until the connection to the server is closed:
# mdnstool -R testreg _printer._tcp local. 515
List all services:
# mdnstool -B _services._dns-sd._udp
List all printers including their IP address:
# mdnstool -C _printer._tcp
List all printers found while stopping the browsing after 2 seconds:
# mdnstool -t2 -B _printer._tcp
If you have a server with more than one interface, you will see that the services are listed for each interface. In the “if” column you will see the interface number:
# mdnstool -t2 -B _printer._tcp Browsing for _printer._tcp Timestamp A/R Flags if Domain Service Type Instance Name 16:48:21.410 Add 3 2 local. _printer._tcp. cpdf-suse113 16:48:21.410 Add 3 2 local. _printer._tcp. ppv-suse113 16:48:21.410 Add 3 2 local. _printer._tcp. p2d-suse113 16:48:21.411 Add 3 3 local. _printer._tcp. cpdf-suse113 16:48:21.411 Add 3 3 local. _printer._tcp. ppv-suse113 16:48:21.411 Add 2 3 local. _printer._tcp. p2d-suse113
If you wish to limit the output to a certain interface only, you may
-p option. In the following example, the
parameter is specified to limit the output to the interface number 3:
# mdnstool -p3 -t2 -B _printer._tcp Set interface to 3 Browsing for _printer._tcp Timestamp A/R Flags if Domain Service Type Instance Name 16:48:21.411 Add 3 3 local. _printer._tcp. cpdf-suse113 16:48:21.411 Add 3 3 local. _printer._tcp. ppv-suse113 16:48:21.411 Add 2 3 local. _printer._tcp. p2d-suse113
Get more information on the printer “testreg” like the complete service name, its host and TXT resources:
# mdnstool -L testreg _printer._tcp
Get the IP address of a local host:
# mdnstool -Q macbook.local.