For example, given the range:

172.128.0.0 - 172.191.255.255

I need to find some domain that resolves to an IP-adress within the range. Is it possible ? I'm using a Linux system.

link|improve this question

feedback

3 Answers

up vote 5 down vote accepted

Well, the DiG utility (man dig) can do reverse-DNS lookups to see if a given IP address has an associated DNS record. AFAIK it only accepts a single address at a time, but you could use some bash looping to generate the commands to check all the addresses.

for i in $(seq 128 191) ; do 
  for j in $(seq 1 255) ; do
    for k in $(seq 1 255) ; do
      dig -x 172.$i.$j.$k
      sleep 5
    done
  done
done

In one line:

for i in $(seq 128 191) ; do for j in $(seq 1 255) ; do for k in $(seq 1 255) ; do dig -x 172.$i.$j.$k ; sleep 5 ; done ; done ; done

You might want the +short option (or other options) to help get the output into some meaningful form. See man dig for possible options; here's the syntax:

dig +short -x 172.$i.$j.$k
link|improve this answer
note this doesn't (to my knowledge) find all possible DNS records, just some DNS record, if it exists. – quack quixote Feb 12 '10 at 22:33
1  
This should do it. (You might want to put a delay in there as well to avoid hammering your DNS server) – mpeterson Feb 13 '10 at 1:17
good tip. i meant to point that out explicitly but managed to forget. any additional processing desired can be added; add into the innermost loop if that step is wanted per-address. – quack quixote Feb 13 '10 at 1:34
feedback

There are many online tools that do this on an IP by IP basis, eg:

link|improve this answer
feedback

I take a chance, I'm not sure if my answer is good...

http://lists.samba.org/archive/samba-ntdom/1999-June/005094.html

Thanks, David

link|improve this answer
I believe that nmblookup is not a DNS tool. – eugene y Feb 12 '10 at 22:43
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.