Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

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
share|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
add comment

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

share|improve this answer
add comment

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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