author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 22 Feb 2016 13:34:55 +0200 | |
changeset 1911 | 870693ce6ff0 |
parent 1887 | 7ace23894f44 |
child 1912 | 8b81a8f0f692 |
permissions | -rw-r--r-- |
1862
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
.. -*- coding: utf-8; -*- |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
.. include:: HEADER.rst |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
====== |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
DNS. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
====== |
1911
870693ce6ff0
Fix my RST article style by 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1887
diff
changeset
|
7 |
.. contents:: |
870693ce6ff0
Fix my RST article style by 'check-format-policy' target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1887
diff
changeset
|
8 |
:local: |
1862
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
About DNS resolving protocol. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
11 |
============================= |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
12 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
13 |
Default port for name resolving is ``53``:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
14 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
15 |
$ nslookup -port=53 microsoft.com |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
16 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
17 |
Debugging name resolution. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
18 |
========================== |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
19 |
:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
20 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
21 |
$ nslookup -debug microsoft.com |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
22 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
23 |
Dumping all available resords:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
24 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
25 |
$ nslookup -type=any microsoft.com |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
26 |
|
1863
1532554ca0b4
Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1862
diff
changeset
|
27 |
Timing information and traces available via:: |
1532554ca0b4
Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1862
diff
changeset
|
28 |
|
1532554ca0b4
Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1862
diff
changeset
|
29 |
$ dig +trace google.com |
1532554ca0b4
Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1862
diff
changeset
|
30 |
$ dig @8.8.4.4 +noall +answer +stats A defun.work |
1532554ca0b4
Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1862
diff
changeset
|
31 |
|
1873
d64682ab74a2
``+additional`` option
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1863
diff
changeset
|
32 |
Despite ``dig`` shown only names for NS replays also have IP adresses (to avoid |
d64682ab74a2
``+additional`` option
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1863
diff
changeset
|
33 |
chicken/egg ptoblem when you request name resolution but asked to resolve |
d64682ab74a2
``+additional`` option
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1863
diff
changeset
|
34 |
another name). To see IP addressed use ``+additional`` option:: |
d64682ab74a2
``+additional`` option
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1863
diff
changeset
|
35 |
|
d64682ab74a2
``+additional`` option
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1863
diff
changeset
|
36 |
$ dig +trace +additional google.com |
d64682ab74a2
``+additional`` option
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1863
diff
changeset
|
37 |
|
1862
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
38 |
IP from host name. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
39 |
================== |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
40 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
41 |
This request is for the ``A`` record and default for ``nslookup`` command:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
42 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
43 |
$ nslookup defun.work |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
44 |
$ nslookup -type=a defun.work |
1863
1532554ca0b4
Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1862
diff
changeset
|
45 |
$ nslookup -type=a defun.work 8.8.8.8 |
1532554ca0b4
Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1862
diff
changeset
|
46 |
|
1532554ca0b4
Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1862
diff
changeset
|
47 |
$ dig @8.8.8.8 A defun.work |
1532554ca0b4
Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1862
diff
changeset
|
48 |
$ dig +nocmd +noall +answer defun.work |
1862
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
49 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
50 |
Host name from IP. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
51 |
================== |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
52 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
53 |
If that information available:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
54 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
55 |
$ nslookup -type=ptr 8.8.8.8 |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
56 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
57 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
58 |
List authoritative NS for domain. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
59 |
================================= |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
60 |
:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
61 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
62 |
$ dig ns defun.work |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
63 |
$ nslookup -type=ns defun.work |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
64 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
65 |
List MX records for domain. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
66 |
=========================== |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
67 |
:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
68 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
69 |
$ dig mx mail.google.com |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
70 |
$ nslookup -type=mx mail.google.com |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
71 |
|
1881
889e37c1c5b5
Query for TXT records.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1874
diff
changeset
|
72 |
Query for TXT records. |
889e37c1c5b5
Query for TXT records.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1874
diff
changeset
|
73 |
====================== |
889e37c1c5b5
Query for TXT records.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1874
diff
changeset
|
74 |
:: |
889e37c1c5b5
Query for TXT records.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1874
diff
changeset
|
75 |
|
889e37c1c5b5
Query for TXT records.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1874
diff
changeset
|
76 |
$ dig -t TXT google.com |
889e37c1c5b5
Query for TXT records.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1874
diff
changeset
|
77 |
$ dig google.com TXT |
889e37c1c5b5
Query for TXT records.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1874
diff
changeset
|
78 |
$ nslookup -type=txt google.com |
1887 | 79 |
$ nslookup -q=txt google.com |
1881
889e37c1c5b5
Query for TXT records.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1874
diff
changeset
|
80 |
$ host -t txt google.com |
889e37c1c5b5
Query for TXT records.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1874
diff
changeset
|
81 |
|
1862
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
82 |
List SOA records for domain. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
83 |
============================ |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
84 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
85 |
SOA ("Start Of Authority") Record for a domain provides technical information |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
86 |
about the domain:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
87 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
88 |
$ dig soa defun.work |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
89 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
90 |
Human readable format can be viewed via:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
91 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
92 |
$ nslookup -type=mx defun.work |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
93 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
94 |
origin = ns1.mindsandmachines.com |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
95 |
mail addr = admin.mindsandmachines.com |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
96 |
serial = 2011091101 |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
97 |
refresh = 10800 |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
98 |
retry = 7200 |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
99 |
expire = 604800 |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
100 |
minimum = 86400 |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
101 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
102 |
Email adress for domain administrator is ``admin@mindsandmachines.com`` for |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
103 |
above output. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
104 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
105 |
List domain names. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
106 |
================== |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
107 |
:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
108 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
109 |
$ dig ns dp.gov.ua |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
110 |
... |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
111 |
;; ANSWER SECTION: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
112 |
dp.gov.ua. 3600 IN NS ns.giknpc.com.ua. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
113 |
... |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
114 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
115 |
$ dig @ns.giknpc.com.ua dp.gov.ua AXFR |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
116 |
... |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
117 |
dp.gov.ua. 3600 IN MX 200 relay2.giknpc.com.ua. |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
118 |
dp.gov.ua. 3600 IN A 195.64.190.1 |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
119 |
adm.dp.gov.ua. 3600 IN A 195.64.190.1 |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
120 |
|
1874 | 121 |
Get info about NS. |
122 |
================== |
|
123 |
||
124 |
Version of running NS:: |
|
125 |
||
126 |
$ dig @4.2.2.1 version.bind chaos txt |
|
127 |
$ nslookup -q=txt -class=CHAOS version.bind. 4.2.2.1 |
|
128 |
||
129 |
Server name:: |
|
130 |
||
131 |
$ dig @4.2.2.1 id.server txt chaos |
|
132 |
$ nslookup -q=txt -class=CHAOS id.server. 4.2.2.1 |
|
133 |
||
134 |
$ dig @4.2.2.1 hostname.bind txt chaos |
|
135 |
$ nslookup -q=txt -class=CHAOS hostname.bind. 4.2.2.1 |
|
136 |
||
137 |
That strings come from BIND config:: |
|
138 |
||
139 |
options { |
|
140 |
version "none of your business"; |
|
141 |
server-id "Host A"; |
|
142 |
hostname "Host A"; |
|
143 |
}; |
|
144 |
||
1862
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
145 |
How reread config file? |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
146 |
======================= |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
147 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
148 |
FreeBSD:: |
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
149 |
|
f4e844aa1217
Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
150 |
$ named.reload |