- trixie 0.12-5
- trixie-backports 1.2-1~bpo13+1
- testing 1.2-1
- unstable 1.2-1
| MQUERY(1) | General Commands Manual | MQUERY(1) |
NAME¶
mquery — small
query tool for multicast DNS
SYNOPSIS¶
mquery |
[-hDLsTv] [-6]
[-i IFACE]
[-d HOST]
[-l LEVEL]
[-t TYPE]
[-w SEC]
[NAME] |
DESCRIPTION¶
mquery is a companion tool to
mdnsd(8), but can also be used stand-alone with other mDNS
responders. It sends mDNS queries and prints the replies, much like
mdns-scan(1), but it also resolves what it finds. With
-D it follows each service PTR to its SRV, TXT, and
address records and prints a device table, and with
-T or -w it stops on its own
instead of running until interrupted.
By default mquery browses all service
types on the link. Give a service type, such as
_http._tcp, to list its instances, or a host or
instance name together with -t to resolve a specific
record. The .local. domain is appended automatically
unless the name is already rooted with a trailing dot.
mquery runs on the system default
interface, derived from the routing table; use -i
IFACE to run on another.
OPTIONS¶
This program follows the usual UNIX command line syntax. The options are as follows:
-6- Query over IPv6 (the ff02::fb group) instead of IPv4.
-h- Print a bare bones help message and exits.
-D- Scan all services and present a deduplicated device table with name,
address, and product columns. Use with
-Tto exit automatically, or with-wSEC to set a fixed collection window. -T- Terminate automatically after the network has been quiet for two seconds.
Intended for use with
-Dor-d, analogous to avahi-browse(1)'s-toption. -dHOST- Like
-D, but filter results to HOST and show a detailed per-service breakdown instead of the summary table. HOST may be given with or without the.local.suffix. -iIFACE- Interface to run query on, by default the system default interface is
used, derived from the routing table.
Only available on Linux.
-L- Ignore replies from services on the local host. By default
mqueryshows them, so an mdnsd(8) or avahi-daemon(8) on the same machine is discoverable; use-Lto skip the local host, like avahi-browse(1)'s-l,--ignore-localoption. -lLEVEL- Set the log level: none, err, notice (default), info, or debug.
-s- Simple output: print one line per record as it arrives, instead of the
default browse that follows service PTR records. Implied
whenever
-trequests a type other than PTR. -tTYPE- Query for the given record TYPE, a numeric DNS type,
default 12 (PTR). For any type other than PTR the
replies are printed directly, as if
-swere given. The common types are:- A (1)
- IPv4 address
- NS (2)
- name server
- CNAME (5)
- alias (canonical name)
- PTR (12)
- service instance or pointer
- TXT (16)
- service metadata
- AAAA (28)
- IPv6 address
- SRV (33)
- service target host and port
- ANY (255)
- any of the above
-v- Show program version, along with the project homepage and the address for bug reports.
-wSEC- Delay (approximate) in seconds before automatically exiting.
EXAMPLES¶
Browse all service types on the link:
mqueryList the SSH servers, then resolve one to its host and port:
mquery _ssh._tcpmquery -t 33
myhost._ssh._tcpLook up a host's address, or a service's TXT metadata:
mquery -t 1 myhostmquery -t 16
myhost._ssh._tcpScan the link and resolve it into a device table:
mquery -DShow one device in detail, or let the scan stop itself for scripting:
mquery -d myhostmquery -D -TQuery over IPv6 instead of IPv4:
mquery -6 _http._tcpThe .local. domain is implied in all of
these, and -D and -d print
their table on Ctrl-C or, for scripts, with -T or
-w SEC.
SEE ALSO¶
AUTHORS¶
This mDNS-SD implementation was created in 2003 by
Jeremie Miller ⟨jer@jabber.org⟩. Much
later, in 2016, it was adopted by
Joachim Wiberg ⟨troglobit@gmail.com⟩ for
further development and maintenance at GitHub:
⟨https://github.com/troglobit/mdnsd⟩.
| Jun 30 2026 | Nixpkgs |