mdnsctl —
control the Multicast DNS server
daemon
mdnsctl |
command [argument ...] |
The mdnsctl program controls the
mdnsd(8) daemon, it can perform simples mDNS lookups, as well
as browsing and publishing mDNS/DNS-SD services.
The following commands are available:
lookup
[rr-types] host.local
- Look up resource records for host.local. The
optional rr-types specifies which type of resource
record should be looked up. It can be any combination of the following:
-a
- A record (IPv4 Address). This is the default.
-h
- HINFO record (Host Information).
-s
- SRV record (Service). Unimplemented.
-t
- TXT record (Text). Unimplemented.
rlookup
a.b.c.d
- Reverse lookup an IPv4 address in the a.b.c.d form,
use this to obtain the hostname of the given address.
browse
[-r] [-s]
[application proto]
- Browse for application services of type application
for the given transport protocol proto.
application may be any application service type,
like http, workstation, ftp, printer... proto must
be either tcp or udp. Defaults to all services if none specified.
publish
service-name application
proto port
text-string
- Publish services via dns-sd, service-name is the
unique chosen name for the service, it can be any string up to 63
characters. The application is the application
protocol for the service, like http, ftp... proto is
the transport protocol, must be either tcp or udp.
port is the tcp or udp port.
text-string is the string in the TXT record for the
given service, it can be used to express additional service
information.
proxy
service-name application
proto port
host address
text-string
- Proxy publish a service running on a different machine, in addition to the
arguments used for publish,
host is a fully qualified domain name (FQDN) of the
target machine, address is an IPv4 address for the
target machine in the a.b.c.d form.
- /var/run/mdnsctl.sock
- Unix-domain socket used for communication with
mdnsd(8).
The following examples demonstrate some basic uses of
mdnsctl.
Lookup a host A and HINFO record
# mdnsctl lookup -ah
foobar.local
Reverse lookup an address
# mdnsctl rlookup
192.168.8.32
Browse up all services in the local network
# mdnsctl browse
Browse and resolve all services
# mdnsctl browse -r
Browse and resolve all services and output in script-readable
format
# mdnsctl browse -rs
Browse and resolve all the http services in the local network
# mdnsctl browse -r http
tcp
Publish a simple ftp service
# mdnsctl publish myftp ftp tcp 21
user=foobar
Proxy publish a https service that has www.mysite.com as the
target
# mdnsctl proxy mysite https tcp 443
www.mysite.com 12.3.45.6 user=foobar
mdnsctl is released under the ISC
license.
The mdnsctl program version 0.1 was
released in 13 February 2011.