Analýza DNS programem nslookup
Z Milan Kerslager
Program nslookup je považován za zastaralý nástroj. Obsahuje chyby, které již nikdo neopravuje a nahradil ho program dig (viz článek Analýza DNS programem dig). Nicméně program nslookup je přítomen v základní instalaci Windows XP (a příbuzných systémů), proto se jeho ovládání stále může hodit.
Tučně psaný text vkládá uživatel, výzva systému (shell) je zde uvozena znakem dolar ($). Ostatní text je výstup programu tak, jak ho uživatel mohl vidět.
Obsah
Převod jména na IP adresu a zpět
$ nslookup ftp.tul.cz Server: neptun.spsselib.hiedu.cz Address: 194.108.45.33 Non-authoritative answer: Name: obelix.tul.cz Address: 147.230.16.8 Aliases: ftp.tul.cz $ nslookup 147.230.16.8 Server: neptun.spsselib.hiedu.cz Address: 194.108.45.33 Non-authoritative answer: Name: obelix.tul.cz Address: 147.230.16.8
Práce v interaktivním režimu programu nslookup
$ nslookup
Default Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
> www.whitehouse.gov
Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
Name: www.whitehouse.gov
Addresses: 198.137.240.91, 198.137.240.92
> 147.230.16.1
Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
Name: bubo.tul.cz
Address: 147.230.16.1
> set type=SOA
> spsselib.hiedu.cz
Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
spsselib.hiedu.cz
origin = neptun.spsselib.hiedu.cz
mail addr = hostmaster.neptun.spsselib.hiedu.cz
serial = 99010700
refresh = 28800 (8H)
retry = 7200 (2H)
expire = 3600000 (5w6d16h)
minimum ttl = 259200 (3D)
spsselib.hiedu.cz nameserver = neptun.spsselib.hiedu.cz
spsselib.hiedu.cz nameserver = bubo.tul.cz
spsselib.hiedu.cz nameserver = jonas.hiedu.cz
neptun.spsselib.hiedu.cz internet address = 194.108.45.33
bubo.tul.cz internet address = 147.230.16.1
jonas.hiedu.cz internet address = 194.108.211.66
> set type=MX
> spsselib.hiedu.cz
Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
spsselib.hiedu.cz preference = 100, mail exchanger = adis.cesnet.cz
spsselib.hiedu.cz preference = 200, mail exchanger = vscht.vscht.cz
spsselib.hiedu.cz preference = 0, mail exchanger = neptun.spsselib.hiedu.cz
spsselib.hiedu.cz preference = 50, mail exchanger = bubo.tul.cz
spsselib.hiedu.cz nameserver = neptun.spsselib.hiedu.cz
spsselib.hiedu.cz nameserver = bubo.tul.cz
spsselib.hiedu.cz nameserver = jonas.hiedu.cz
adis.cesnet.cz internet address = 194.50.6.3
vscht.vscht.cz internet address = 147.33.1.1
neptun.spsselib.hiedu.cz internet address = 194.108.45.33
bubo.tul.cz internet address = 147.230.16.1
jonas.hiedu.cz internet address = 194.108.211.66
> set q=any
> spsselib.hiedu.cz
Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
spsselib.hiedu.cz nameserver = neptun.spsselib.hiedu.cz
spsselib.hiedu.cz nameserver = bubo.tul.cz
spsselib.hiedu.cz nameserver = jonas.hiedu.cz
spsselib.hiedu.cz text = "Secondary technical school in Liberec"
spsselib.hiedu.cz preference = 100, mail exchanger = adis.cesnet.cz
spsselib.hiedu.cz preference = 200, mail exchanger = vscht.vscht.cz
spsselib.hiedu.cz preference = 0, mail exchanger = neptun.spsselib.hiedu.cz
spsselib.hiedu.cz
origin = neptun.spsselib.hiedu.cz
mail addr = hostmaster.neptun.spsselib.hiedu.cz
serial = 99010700
refresh = 28800 (8H)
retry = 7200 (2H)
expire = 3600000 (5w6d16h)
minimum ttl = 259200 (3D)
spsselib.hiedu.cz preference = 50, mail exchanger = bubo.tul.cz
spsselib.hiedu.cz nameserver = neptun.spsselib.hiedu.cz
spsselib.hiedu.cz nameserver = bubo.tul.cz
spsselib.hiedu.cz nameserver = jonas.hiedu.cz
neptun.spsselib.hiedu.cz internet address = 194.108.45.33
bubo.tul.cz internet address = 147.230.16.1
jonas.hiedu.cz internet address = 194.108.211.66
adis.cesnet.cz internet address = 194.50.6.3
vscht.vscht.cz internet address = 147.33.1.1
> prum.spsselib.hiedu.cz
Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
prum.spsselib.hiedu.cz CPU = PC 586 OS = NOVELL 4.11
prum.spsselib.hiedu.cz preference = 100, mail exchanger = adis.cesnet.cz
prum.spsselib.hiedu.cz preference = 200, mail exchanger = vscht.vscht.cz
prum.spsselib.hiedu.cz preference = 0, mail exchanger = neptun.spsselib.hiedu.cz
prum.spsselib.hiedu.cz preference = 50, mail exchanger = bubo.tul.cz
prum.spsselib.hiedu.cz internet address = 194.108.45.131
spsselib.hiedu.cz nameserver = neptun.spsselib.hiedu.cz
spsselib.hiedu.cz nameserver = bubo.tul.cz
spsselib.hiedu.cz nameserver = jonas.hiedu.cz
adis.cesnet.cz internet address = 194.50.6.3
vscht.vscht.cz internet address = 147.33.1.1
neptun.spsselib.hiedu.cz internet address = 194.108.45.33
bubo.tul.cz internet address = 147.230.16.1
jonas.hiedu.cz internet address = 194.108.211.66
Výpis domény antik-fryc.cz
Výpis domény si musíme vyžádat od nameserverů příslušné domény. Proto nejprve zjistíme, které to jsou a pak se na jeden z nich přepneme. Zadáním příkazu ls -d lze získat podrobnější výpis.
$ nslookup
Default Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
> set q=any
> antik-fryc.cz
Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
antik-fryc.cz
origin = book.antik-fryc.cz
mail addr = Admin.antik-fryc.cz
serial = 98110300
refresh = 28800 (8H)
retry = 3600 (1H)
expire = 1209600 (2W)
minimum ttl = 86400 (1D)
antik-fryc.cz nameserver = book.antik-fryc.cz
antik-fryc.cz nameserver = bubo.tul.cz
antik-fryc.cz text = "Knihkupectvi a antikvariat Jaroslav Fryc"
antik-fryc.cz preference = 10, mail exchanger = bubo.tul.cz
antik-fryc.cz preference = 20, mail exchanger = adis.cesnet.cz
antik-fryc.cz preference = 0, mail exchanger = book.antik-fryc.cz
antik-fryc.cz nameserver = book.antik-fryc.cz
antik-fryc.cz nameserver = bubo.tul.cz
book.antik-fryc.cz internet address = 194.212.169.130
bubo.tul.cz internet address = 147.230.16.1
adis.cesnet.cz internet address = 194.50.6.3
> server book.antik-fryc.cz
Default Server: book.antik-fryc.cz
Address: 194.212.169.130
> ls antik-fryc.cz
[book.antik-fryc.cz]
$ORIGIN antik-fryc.cz.
pc3 1D IN A 194.212.169.133
bara 1D IN A 194.212.169.140
pc4 1D IN A 194.212.169.134
pc5 1D IN A 194.212.169.135
gw 1D IN A 194.212.169.129
alena 1D IN A 194.212.169.136
pc6 1D IN A 194.212.169.137
book 1D IN A 194.212.169.130
localhost 1D IN A 127.0.0.1
pc1 1D IN A 194.212.169.131
pc2 1D IN A 194.212.169.132
Reverzní převod IP adresy na jméno
$ nslookup
Default Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
> 62.168.7.194
Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
*** neptun.spsselib.hiedu.cz can't find 62.168.7.194: Non-existent host/domain
> set q=any
> 7.168.62.in-addr.arpa
Server: neptun.spsselib.hiedu.cz
Address: 194.108.45.33
Non-authoritative answer:
7.168.62.in-addr.arpa
origin = ns.ebanka.cz
mail addr = dpikalek.expandia.com
serial = 1998103003
refresh = 10800 (3H)
retry = 1800 (30M)
expire = 604800 (1W)
minimum ttl = 86400 (1D)
Authoritative answers can be found from: 62.in-addr.arpa nameserver = NS.RIPE.NET 62.in-addr.arpa nameserver = NS.EU.NET 62.in-addr.arpa nameserver = AUTH03.NS.UU.NET NS.RIPE.NET internet address = 193.0.0.193 NS.EU.NET internet address = 192.16.202.11 AUTH03.NS.UU.NET internet address = 198.6.1.83