aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 2fd4c3e615513670b20f321532660045f1d55e4f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# rdns
Quickly look up reverse DNS names.  One of them or lots of them.

Look them up by IPv4 address:
```sh
$ rdns 192.0.43.7
# 192.0.43.7
192.0.43.7	icann.org.
```
Look them up by IPv6 address:
```sh
$ rdns 2001:500:88:200::8
# 2001:500:88:200::8
2001:500:88:200::8	iana.org.
```
Look up ranges of them:
```sh
$ rdns 192.0.43.7/29
# 192.0.43.7/29
192.0.43.0	# error: lookup 192.0.43.0: nodename nor servname provided, or not known
192.0.43.1	43-1.any.icann.org.
192.0.43.2	43-2.any.icann.org.
192.0.43.3	43-3.any.icann.org.
192.0.43.4	43-4.any.icann.org.
192.0.43.5	43-5.any.icann.org.
192.0.43.6	43-6.any.icann.org.
192.0.43.7	icann.org.
```
Look them up by forward name:
```sh
$ rdns arin.net
# arin.net
2001:500:4:c000::43	www.arin.net.
2001:500:4:c000::44	www.arin.net.
199.43.0.43	www.arin.net.
199.43.0.44	www.arin.net.
```
Look them up by all of the above at once:
```sh
$ rdns 192.0.43.7 2001:500:88:200::8 192.0.43.7/29 arin.net
# 192.0.43.7
192.0.43.7	icann.org.
# 2001:500:88:200::8
2001:500:88:200::8	iana.org.
# 192.0.43.7/29
192.0.43.0	# error: lookup 192.0.43.0: nodename nor servname provided, or not known
192.0.43.1	43-1.any.icann.org.
192.0.43.2	43-2.any.icann.org.
192.0.43.3	43-3.any.icann.org.
192.0.43.4	43-4.any.icann.org.
192.0.43.5	43-5.any.icann.org.
192.0.43.6	43-6.any.icann.org.
192.0.43.7	icann.org.
# arin.net
2001:500:4:c000::43	www.arin.net.
2001:500:4:c000::44	www.arin.net.
199.43.0.43	www.arin.net.
199.43.0.44	www.arin.net.
```
Errors go to stderr so they're easy to filter out if you're scanning a sparse net and don't care about failures:
```sh
$ rdns 4.2.2.0/27 2>/dev/null
# 4.2.2.0/27
4.2.2.1	a.resolvers.level3.net.
4.2.2.2	b.resolvers.level3.net.
4.2.2.3	c.resolvers.level3.net.
4.2.2.4	d.resolvers.level3.net.
4.2.2.5	e.resolvers.level3.net.
4.2.2.6	f.resolvers.level3.net.
4.2.2.12	test-record.level3.net.
```

## Installation
```sh
$ go get -u doof.net/cmd/rdns
```

Happy resolving.