dns.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 12 Jan 2016 00:09:16 +0200
changeset 1863 1532554ca0b4
parent 1862 f4e844aa1217
child 1873 d64682ab74a2
permissions -rw-r--r--
Timing information and traces.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
======
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
About DNS resolving protocol.
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
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
Default port for name resolving is ``53``::
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
  $ nslookup -port=53 microsoft.com
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
Debugging name resolution.
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
::
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
  $ nslookup -debug microsoft.com
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
Dumping all available resords::
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
  $ nslookup -type=any microsoft.com
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
1863
1532554ca0b4 Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1862
diff changeset
    25
Timing information and traces available via::
1532554ca0b4 Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1862
diff changeset
    26
1532554ca0b4 Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1862
diff changeset
    27
  $ dig +trace google.com
1532554ca0b4 Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1862
diff changeset
    28
  $ 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
    29
1862
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
IP from host name.
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
==================
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
This request is for the ``A`` record and default for ``nslookup`` command::
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
  $ nslookup defun.work
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
  $ nslookup -type=a defun.work
1863
1532554ca0b4 Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1862
diff changeset
    37
  $ nslookup -type=a defun.work 8.8.8.8
1532554ca0b4 Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1862
diff changeset
    38
1532554ca0b4 Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1862
diff changeset
    39
  $ dig @8.8.8.8 A defun.work
1532554ca0b4 Timing information and traces.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1862
diff changeset
    40
  $ dig +nocmd +noall +answer defun.work
1862
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
Host name from IP.
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
==================
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    44
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    45
If that information available::
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    46
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    47
  $ nslookup -type=ptr 8.8.8.8
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    48
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
List authoritative NS for domain.
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
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    54
  $ dig ns defun.work
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    55
  $ nslookup -type=ns defun.work
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
List MX records for domain.
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    58
===========================
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
  $ dig mx mail.google.com
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    62
  $ nslookup -type=mx mail.google.com
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    63
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    64
List SOA records for domain.
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    65
============================
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
SOA ("Start Of Authority") Record for a domain provides technical information
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    68
about the domain::
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    69
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    70
  $ dig soa defun.work
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    71
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    72
Human readable format can be viewed via::
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    73
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    74
  $ nslookup -type=mx defun.work
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    75
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
    origin = ns1.mindsandmachines.com
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    77
    mail addr = admin.mindsandmachines.com
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    78
    serial = 2011091101
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    79
    refresh = 10800
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    80
    retry = 7200
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    81
    expire = 604800
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
    minimum = 86400
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
Email adress for domain administrator is ``admin@mindsandmachines.com`` for
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
above output.
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
List domain names.
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    88
==================
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
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    91
  $ dig ns dp.gov.ua
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    92
  ...
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    93
  ;; ANSWER SECTION:
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    94
  dp.gov.ua.              3600    IN      NS      ns.giknpc.com.ua.
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    95
  ...
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    96
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    97
  $ dig @ns.giknpc.com.ua dp.gov.ua AXFR
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    98
  ...
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    99
  dp.gov.ua.              3600    IN      MX      200 relay2.giknpc.com.ua.
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   100
  dp.gov.ua.              3600    IN      A       195.64.190.1
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   101
  adm.dp.gov.ua.          3600    IN      A       195.64.190.1
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   102
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   103
How reread config file?
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
f4e844aa1217 Debugging name resolution.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   106
FreeBSD::
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
  $ named.reload