「drill」の版間の差分

提供: FreeBSD入門
移動: 案内検索
(使い方)
 
行28: 行28:
 
;drill mx foo.local: MXレコードを調べます。
 
;drill mx foo.local: MXレコードを調べます。
 
;drill -S foo.local: foo.local ドメインのシグネチャを探します。
 
;drill -S foo.local: foo.local ドメインのシグネチャを探します。
;drill -TD foo.local: ルートサーバーからfoo.localへ[[DNSSEC]](-D) 追跡 (-T)します。
+
;drill -TD foo.local: ルートサーバーからfoo.localへ DNSSEC (-D) 追跡 (-T)します。
 
;drill -s dnskey foo.local:foo.localのDNSKEYレコードを表示します。みつかったDNKEYレコードとDSレコードを表示します。
 
;drill -s dnskey foo.local:foo.localのDNSKEYレコードを表示します。みつかったDNKEYレコードとDSレコードを表示します。
 
=== コマンドラインオプション ===
 
=== コマンドラインオプション ===
行137: 行137:
 
;; MSG SIZE  rcvd: 114
 
;; MSG SIZE  rcvd: 114
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 
== 関連項目 ==
 
== 関連項目 ==
 
{{networkcmd}}
 
{{networkcmd}}
 
<!-- vim: fileencoding=utf-8 filetype=mediawiki
 
<!-- vim: fileencoding=utf-8 filetype=mediawiki
 
-->
 
-->

2015年9月27日 (日) 22:33時点における最新版

drill とは、FreeBSD 10.0-RELEASEから追加されたdigの代替コマンドで、 DNS (SEC)の情報を取得するコマンドです。

読み方

drill
どりる

概要

drillは、 DNS のすべての種類の情報を取得するためにデザインされたツールです。特に DNSSEC で使われるために設計されています。

drill(ドリル)という名前は、dig(発掘)に対する洒落です。digよりも多くの情報を取得できます。

引数が指定されない場合は、デフォルトでクラスは、IN、タイプはAが与えられます。問い合わせに対しては、 /etc/resolv.conf に指定されたサーバーが利用されます。

drill name [@server] [type] [class]
name
問い合わせする名前です。
@server
問い合わせを投げるサーバーです。指定されない場合は、/etc/resolv.confのネームサーバーが使用されます。
type
問い合わせするRRタイプです。コマンドラインで指定されない場合は、デフォルトで A が使用されます。リバースルックップを行うときは、デフォルトでPTRです。
class
問い合わせのときのクラスです。

-kオプションが指定されない場合、信頼できる鍵は、/etc/unbound/root.keyからロードされます。

インストール

FreeBSD 10.0-RELEASEからデフォルトで入っています。

使い方

drill mx foo.local
MXレコードを調べます。
drill -S foo.local
foo.local ドメインのシグネチャを探します。
drill -TD foo.local
ルートサーバーからfoo.localへ DNSSEC (-D) 追跡 (-T)します。
drill -s dnskey foo.local
foo.localのDNSKEYレコードを表示します。みつかったDNKEYレコードとDSレコードを表示します。

コマンドラインオプション

root@b0:~ # drill  -h
drill version 1.6.16 (ldns version 1.6.16)
Written by NLnet Labs.
 
Copyright (c) 2004-2008 NLnet Labs.
Licensed under the revised BSD license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.
  Usage: drill name [@server] [type] [class]
        <name>  can be a domain name or an IP address (-x lookups)
        <type>  defaults to A
        <class> defaults to IN
 
        arguments may be placed in random order
 
  Options:
        -D              enable DNSSEC (DO bit)
        -T              trace from the root down to <name>
        -S              chase signature(s) from <name> to a know key [*]
        -V <number>     verbosity (0-5)
        -Q              quiet mode (overrules -V)
 
        -f file         read packet from file and send it
        -i file         read packet from file and print it
        -w file         write answer packet to file
        -q file         write query packet to file
        -h              show this help
        -v              show version
 
  Query options:
        -4              stay on ip4
        -6              stay on ip6
        -a              fallback to EDNS0 and TCP if the answer is truncated
        -b <bufsize>    use <bufsize> as the buffer size (defaults to 512 b)
        -c <file>       use file for rescursive nameserver configuration
                        (/etc/resolv.conf)
        -k <file>       specify a file that contains a trusted DNSSEC key [**]
                        Used to verify any signatures in the current answer.
                        When DNSSEC enabled tracing (-TD) or signature
                        chasing (-S) and no key files are given, keys are read
                        from: /etc/unbound/root.key
        -o <mnemonic>   set flags to:
                        [QR|qr][AA|aa][TC|tc][RD|rd][CD|cd][RA|ra][AD|ad]
                        lowercase: unset bit, uppercase: set bit
        -p <port>       use <port> as remote port number
        -s              show the DS RR for each key in a packet
        -u              send the query with udp (the default)
        -x              do a reverse lookup
        when doing a secure trace:
        -r <file>       use file as root servers hint file
        -t              send the query with tcp (connected)
        -d <domain>     use domain as the start point for the trace
        -y <name:key[:algo]>    specify named base64 tsig key, and optional an
                        algorithm (defaults to hmac-md5.sig-alg.reg.int)
        -z              don't randomize the nameservers before use
 
  [*] = enables/implies DNSSEC
  [**] = can be given more than once
 
  ldns-team@nlnetlabs.nl | http://www.nlnetlabs.nl/ldns/

使用例

user@b0:~ % drill www.yahoo.co.jp
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 56855
;; flags: qr rd ra ; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; www.yahoo.co.jp.     IN      A
 
;; ANSWER SECTION:
www.yahoo.co.jp.        5       IN      CNAME   www.g.yahoo.co.jp.
www.g.yahoo.co.jp.      5       IN      A       183.79.231.182
 
;; AUTHORITY SECTION:
 
;; ADDITIONAL SECTION:
 
;; Query time: 46 msec
;; SERVER: 192.168.60.2
;; WHEN: Fri Jan 31 11:56:19 2014
;; MSG SIZE  rcvd: 69

MXレコードを調べる

user@b0:~ % drill mx yahoo.co.jp
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 45631
;; flags: qr rd ra ; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; yahoo.co.jp. IN      MX
 
;; ANSWER SECTION:
yahoo.co.jp.    5       IN      MX      10 mx1.mail.yahoo.co.jp.
yahoo.co.jp.    5       IN      MX      10 mx3.mail.yahoo.co.jp.
yahoo.co.jp.    5       IN      MX      10 mx2.mail.yahoo.co.jp.
yahoo.co.jp.    5       IN      MX      10 mx5.mail.yahoo.co.jp.
 
;; AUTHORITY SECTION:
 
;; ADDITIONAL SECTION:
 
;; Query time: 44 msec
;; SERVER: 192.168.60.2
;; WHEN: Fri Jan 31 11:57:28 2014
;; MSG SIZE  rcvd: 114

関連項目

  • ifconfig
  • route
  • ping
  • traceroute
  • tcpdump
  • netstat
  • drill
  • dig (drillを使用してください)