Something like this maybe:
#!/bin/bash
while read ip n
do
# Uncomment following to use /etc/hosts
# name=$(awk -v ip=$ip '$1 ~ ip{print $2}' /etc/hosts)
# Uncomment following to use nslookup
# name=$(nslookup $ip| grep "name ="|sed 's/.*=//')
# Uncomment following line to use dig (thanks to Charles Duffy)
# name=$(dig +short -x $ip)
echo $name $n
done < file