for domain in `cat domains.txt`; do ip=`host $domain|grep address|awk '{print $4}'`;echo $domain=$ip; done;
The only thing you need to change is domains.txt if your filename is different which is expected to just be a list of all the domains/hostnames you want to find the IP of.
domain.com=1.2.3.4
linux, bash, ip, hostnamesfor, domain, domains, txt, grep, awk, echo, filename, hostnames,