FreeBSD 11.1 RELEASE - DNS サーバ - nslookup → drill

クラウディア 
1. 概要
2. dig、nslookup を使うには
3. アドレスの引き方

1. 概要

 FreeBSD 10.0 RELEASE 以降、BIND が標準インストールされなくなったのに伴い、nslookup もなくなっています。  代わりに drill を使用します。  10.x 以前でも unbound をインストールすると drill が同時にインストールされます。

2. dig、nslookup を使うには

 実は、dig には short モードというのがあってちょっとそれを使うようなときもあるのです。  dignslookup を使うには

プロンプト略
cd /usr/ports/dns/bind-tools
make
make install

3. アドレスの引き方

 drill の形式は基本的に nslookup と同じと考えてよいです。  www.google.co.jp を例にして nslookupdrill の出力を比べてみます。  nslookup 正引き

> nslookup www.google.co.jp
Server:         DNSキャッシュサーバ名
Address:        DNSキャッシュサーバIPアドレス#53	←	53 とあるのはポート番号です

Non-authoritative answer:
Name:   www.google.co.jp
Address: 74.125.235.239
Name:   www.google.co.jp
Address: 74.125.235.248
Name:   www.google.co.jp
Address: 74.125.235.247
 drill 正引き

> drill www.google.co.jp
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 27985
;; flags: qr rd ra ; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; www.google.co.jp.    IN      A

;; ANSWER SECTION:
www.google.co.jp.       226     IN      A       74.125.235.239
www.google.co.jp.       226     IN      A       74.125.235.248
www.google.co.jp.       226     IN      A       74.125.235.247

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 2 msec # ← 実行時間
;; SERVER: "DNSキャッシュサーバ名"
;; WHEN: "実行した日時"
;; MSG SIZE  rcvd: 82 # ← メッセージサイズ
 nslookup 逆引き

> nslookup 74.125.235.239
Server:         DNSキャッシュサーバ名
Address:        DNSキャッシュサーバIPアドレス#53

Non-authoritative answer:
239.235.125.74.in-addr.arpa     name = kix01s02-in-f15.1e100.net.

Authoritative answers can be found from:
125.74.in-addr.arpa     nameserver = ns3.google.com.
125.74.in-addr.arpa     nameserver = ns4.google.com.
125.74.in-addr.arpa     nameserver = ns2.google.com.
125.74.in-addr.arpa     nameserver = ns1.google.com.
ns1.google.com  internet address = 216.239.32.10
ns2.google.com  internet address = 216.239.34.10
ns3.google.com  internet address = 216.239.36.10
ns4.google.com  internet address = 216.239.38.10
 drill 逆引き

> drill -x 74.125.235.239
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 51080
;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; 239.235.125.74.in-addr.arpa. IN      PTR

;; ANSWER SECTION:
239.235.125.74.in-addr.arpa.    7200    IN      PTR     kix01s02-in-f15.1e100.net.

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 3689 msec   ← 実行時間
;; SERVER: DNSキャッシュサーバ名
;; WHEN: 実行した日時
;; MSG SIZE  rcvd: メッセージサイズ
1行目  逆引きの場合、オプションに -x を使用することにご注意ください。 Tips  drill とほとんど同じコマンドに dig というのがあります。
 drill の方が dig より詳細な情報まで調べられるということですが。drill (ドリル、いわゆる掘削機ですな)というのは dig (発掘) に対する洒落なのだそうな・・・。