Sending queries
To send DNS queries, just pass in the domain you want to query as a command-line argument.
By default, dog will request A records.
dog example.com
Specifying record types
You can request other types of record, such as MX or AAAA, by including an all-caps argument.
dog example.com MX
Specifying nameservers
You can specify which DNS server the request should be sent to by prefixing an argument with the “@
” character.
dog example.com @8.8.4.4
Specifying classes
The DNS protocol actually has support for different classes of networked computers.
By default, DNS requests are queried with the IN
(Internet) class, but there’s also CH
(Chaosnet), an early network, and HS
(Hesiod), an alternate naming system.
To use any of these three, pass them as command-line arguments.
There are no record types called IN
, HS
, or CH
, so this is unambiguous.
dog example.com CH
Long-form arguments
This command-line syntax was picked because it’s easy to type on a whim. However, if you’re using dog as part of an automated script, or you want to be less ambiguous, there are long-form versions of the above:
- The
-q
or--query
options specify domains to query. - The
-t
or--type
options specify record types. - The
-c
or--class
options specify DNS classes. - The
-n
or--nameserver
options specify DNS servers to send requests to.
dog -q example.com -t A -n 1.1.1.1