mdig.js/README.md

101 lines
2.1 KiB
Markdown
Raw Normal View History

2017-11-03 05:43:15 +00:00
mdig.js
=======
2017-02-25 20:43:20 +00:00
2017-11-03 05:43:15 +00:00
| [dns-suite.js](https://git.coolaj86.com/coolaj86/dns-suite.js)
| [dig.js](https://git.coolaj86.com/coolaj86/dig.js)
| [digd.js](https://git.coolaj86.com/coolaj86/digd.js)
| **mdig.js**
| Sponsored by [Daplie](https://daplie.com).
2017-02-25 20:43:20 +00:00
2017-11-03 05:46:34 +00:00
multicast dig, in JavaScript (ES5.1)
Create and capture mDNS query and response packets to disk as binary and/or JSON.
Options are similar to the Unix `dig` command, but for mDNS.
2017-02-25 20:43:20 +00:00
Install with git
-------
```bash
# Install the latest of v1.x
2017-11-03 05:43:15 +00:00
npm install -g 'git+https://git.coolaj86.com/coolaj86/mdig.git#v1'
2017-02-25 20:43:20 +00:00
```
```bash
# Install exactly v1.0.0
2017-11-03 05:43:15 +00:00
npm install -g 'git+https://git.coolaj86.com/coolaj86/mdig.git#v1.0.0'
2017-02-25 20:43:20 +00:00
```
Install without git
-------
Don't have git? Well, you can also bow down to the gods of the centralized, monopolized, concentrated, dictator-net
(as we like to call it here at Daplie Labs), if that's how you roll:
```bash
npm install -g mdig
```
Usage
-----
### Format
```bash
mdig [TYPE] <query>
```
### Example
```bash
mdig PTR _services._dns-sd._udp.local
```
### defaults
When run with no options `mdig` will run with these as the default:
```bash
mdig -p 5353 @224.0.0.251 PTR _services._dns-sd._udp.local +time=3
```
### Non-standard mDNS
For debugging you may use a non-standard port and address
```bash
# non-standard port
mdig -p 1900
# non-standard broadcast address
mdig @239.255.255.250
```
### Common Service Types
```
_ssh._tcp.local
_sftp-ssh._tcp.local"
_nfs._tcp.local
_pdl-datastream._tcp.local
_printer._tcp.local
_ipp._tcp.local
_http._tcp.local
_apple-mobdev2._tcp.local
_workstation._tcp.local
_udisks-ssh._tcp.local
```
Options
-------
```
--debug
--output <path/to/file> write query and response(s) to disk with this path prefix (ex: ./samples/dns)
-t <type> (superfluous) default ANY (mdns default: PTR)
-c <class> default IN
-p <port> default 53 (mdns default: 5353) (listener is random for DNS and 5353 for mDNS)
-q <query> (superfluous) required (ex: daplie.com)
+time=<seconds> Sets the timeout for a query in seconds.
```