Scripting nslookup to resolve multiple hostnames

Hi Friends,

I have a list of servers with their production names in a file.
I want to know the best way eiter a command or a script that can do the following :-

Append "-bkp" to each hostnames at the end
And run nslookup and make sure I have valid backup IP add assigned to it.

Any help would be greatly appriciated. I did a for loop but nslookup is not running in iterative mode. Not sure what is the exact problem.

Thanks in advance.

while read nodename
do
   nslookup ${nodename}-bkp | grep -q '^**' 
   if [[ $? -ne 0 ]] ; then
      echo "no backup for nodename ${nodename}"
   else
      echo " ${nodename} is good"
   fi   
done < listofnodes

This looks for the error string "*** No Address information" ...
If your nslookup error message is different change the grep statement.