LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   DNS Checking tool - check for reverseDNS etc... (https://www.linuxquestions.org/questions/linux-newbie-8/dns-checking-tool-check-for-reversedns-etc-850160/)

djsmiley2k 12-14-2010 09:26 AM

DNS Checking tool - check for reverseDNS etc...
 
Hi all...

I'm in the process of updating the internal DNS records for all of our machines and I'm going a little bit crazy.

Basically I'm wondering if there is a tool, which can check and compare DNS records for me. I'd like to tell it to look at our private subnet, and it for to return records which have missing or different DNS records, than were expected.

Hell, if it just looked up every record and returned it in a "neat" way, that'd work too. (I'm sure someone could script this? but I dont know how! :( ).

Can anyone help?

Tinkster 12-14-2010 11:09 AM

You're not giving us much to go by; you're using bind9, and you
have all the zone files in your hands? Use grep.


You don't have the files?
If you don't have an IDS you could simply let lose
nmap or even an ordinary shell loop w/ your IP range.

Get a list of all your IPs w/ a look-up.
Code:

for i in xx.yy.zz.{1..254}
do
  echo -n $i" : "
  host $i | awk '{if($0~/pointer/){print $NF}else{printf "\n"}'
done



Cheers,
Tink

thllgo 12-14-2010 11:19 AM

If you've got money to spend Solarwinds makes a rather good DNS checking tool. It can compare DNS records to a network search of what is out there compared to what DNS says should be out there.

Bertical 12-14-2010 04:58 PM

A bit basic but useful :

Code:

[titch@quackers:~] $ named-checkzone -D <zonename> <filename>

djsmiley2k 01-24-2011 05:55 AM

Quote:

Originally Posted by Tinkster (Post 4191229)
You're not giving us much to go by; you're using bind9, and you
have all the zone files in your hands? Use grep.


You don't have the files?
If you don't have an IDS you could simply let lose
nmap or even an ordinary shell loop w/ your IP range.

Get a list of all your IPs w/ a look-up.
Code:

for i in xx.yy.zz.{1..254}
do
  echo -n $i" : "
  host $i | awk '{if($0~/pointer/){print $NF}else{printf "\n"}'
done



Cheers,
Tink

Hi Tink, Thats brilliant however there is one flaw, it checks every IP..

I'm wondering how to add a ping in, and only check if the system returns a ping... :)

djsmiley2k 01-24-2011 06:30 AM

#!/bin/bash

for i in 10.103.1.{1..254}
do
ping -c 1 -q $i 2>&1 > /dev/null
if [ $? -eq 0 ];
then
echo -n $i" : "
host $i | awk '{if($0~/pointer/){print $NF}else{printf "\n"}}'
fi
done


Yey~! \o/ thanks all :)


All times are GMT -5. The time now is 10:35 PM.