dns-sd - Multicast DNS (mDNS) & DNS Service Discovery (DNS-SD) Test Tool
dns-sd -R name type domain port [key=value ...]
dns-sd -B type domain
dns-sd -L name type domain
dns-sd -Q FQDN rrtype rrclass
dns-sd -C FQDN rrtype rrclass
dns-sd -P name type domain port host IP [key=value ...]
dns-sd -E | -F | -A | -U | -N | -T | -M | -I
The dns-sd command is a network diagnostic tool, much like ping(1M) or traceroute(1M). However, unlike those tools, most of its functionality is not implemented in the dns-sd executable itself, but in library code that is available to any application. The library API that dns-sd uses is documented in /usr/include/dns_sd.h.
The dns-sd command is primarily intended for interactive use. Because its command-line arguments and output format are subject to change, invoking it from a shell script can be unpredictable. Additionally, the asynchronous nature of DNS Service Discovery does not easily lend itself to script-oriented programming. This style of asynchronous interaction works best with applications that are either multi-threaded, or use a main event-handling loop to receive keystrokes, network data, and other asynchronous event notifications as they happen.
The following options are supported:
-R name type domain port [key=value ...]
name can be any arbitrary unicode text, containing any legal unicode characters (including dots, spaces, slashes, colons, and so on without any restrictions), up to 63 UTF-8 bytes long.
type must be of the form "_app-proto._tcp" or "_app-proto._udp", where "app-proto" is an application protocol name registered at http://www.dns-sd.org/ServiceTypes.html.
domain is the domain in which to register the service. In current implementations, only the local multicast domain "local" is supported. In the future, registering will be supported in any arbitrary domain that has a working DNS Update server [RFC 2136]. The domain "." is a synonym for "pick a sensible default", which currently means "local".
port is a number from 0 to 65535, and is the TCP or UDP port number upon which the service is listening. Registering a service on port 0 allows an application to explicitly advertise the non-availability of a service.
Additional attributes of the service may optionally be described by key/value pairs, which are stored in the advertised service's DNS TXT record. Allowable keys and values are listed with the service registration at http://www.dns-sd.org/ServiceTypes.html
-B type domain
For valid types, see http://www.dns-sd.org/ServiceTypes.html. Omitting the domain name or using "." means "pick a sensible default."
-L name type domain
In a typical application, browsing happens rarely, while lookup (or "resolving") happens every time the service is used. For example, a user does not browse the network to pick a default printer that often, but once a default printer has been picked, that named service is resolved to its current IP address and port number every time the user presses Cmd-P to print.
-Q FQDN rrtype rrclass
-C FQDN rrtype rrclass
-P name type domain port host IP [key=value ...]
-E
-F
-A
-U
-N
-T
-M
-I
Example 1 Advertising a printing service
The following command advertises the existence of LPR printing service on port 515 on this machine, so that it will be available to DNS-SD compatible printing clients:
dns-sd -R "My Test" _printer._tcp. . 515 pdl=application/postscript
For this registration to be useful, the LPR service should be available on port 515. Advertising a service that does not exist is not very useful.
Example 2 Advertising a web page
The following command advertises a web page being served by an HTTP server on port 80 on this machine, so that it will appear on the Bonjour list in Safari and other DNS-SD compatible Web clients:
dns-sd -R "My Test" _http._tcp . 80 path=/path-to-page.html
Example 3 Finding the advertised web pages on the local network
The following command finds the advertised web pages on the local network (the same list that Safari shows):
dns-sd -B _http._tcp
See attributes(5) for descriptions of the following attributes:
|
mdnsd(1M), ping(1M), traceroute(1M), resolv.conf(4), attributes(5)
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |