Link to home
Start Free TrialLog in
Avatar of rammaghenthar
rammaghenthar

asked on

Script required to find duplicate hostname resolve with DNS

Script required to find duplicate hostname resolve with DNS
        In our build environment we want find Duplicate hostname entry against all. We need a script which will run following logic

1.get IPs from file
2. run nslookup <ipaddress1> - it will give hostname1  (it will give only one hostname)
 then again  I need  to type same Ip again to get second hostname.(dublicate hostname)
 nslookup <ipaddress1> it will give hostname2 ( In this example hostname1 and hostname2 pointing to same IP)

So what i need is  nslookup <ipaddress> part need to run two times one after another continuously and outputs need to be compared. If output hostnames differs it need to be pasted as duplicate hostname entry for that IP. if it hostname didn't vary the output don't need to be reported.
        help please.
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

do you own / manage the dns server for the reverse lookup zone? if yes , then you can do simple

grep ipaddress zonefile

to find duplicates
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial