Once the above script is added to a file. Set the executable permission for the “nslookup-command.sh” file.
```
# chmod +x /opt/scripts/nslookup-command.sh
```
Finally run the bash script to get the output.
```
# sh /opt/scripts/nslookup-command.sh
2daygeek.com - 104.27.156.177 104.27.157.177
magesh.co.in - 104.18.35.52 104.18.34.52
linuxtechnews.com - 104.27.144.3 104.27.145.3
```
### Method-4: How to Find a Domain’s IP Address Using the fping Command
**[fping command][6]** is a program such as ping, which uses the Internet Control Message Protocol (ICMP) echo request to determine whether a target host is responding.
fping differs from ping because it allows users to ping any number of host in parallel. Also, hosts can be entered from a text file.
fping sends an ICMP echo request, moves the next target in a round-robin fashion, and does not wait until the target host responds.
If a target host replies, it is noted as active and removed from the list of targets to check; if a target does not respond within a certain time limit and/or retry limit it is designated as unreachable.
```
# fping -A -d 2daygeek.com magesh.co.in linuxtechnews.com
104.27.157.177 (104.27.157.177) is alive
104.18.35.52 (104.18.35.52) is alive
104.27.144.3 (104.27.144.3) is alive
```
### Method-5: How to Find the IP Address of the Domain Using the ping Command
**[ping command][6]** stands for (Packet Internet Groper) command is a networking utility that used to test the target of a host availability/connectivity on an Internet Protocol (IP) network.
It’s verify a host availability by sending Internet Control Message Protocol (ICMP) Echo Request packets to the target host and waiting for an ICMP Echo Reply.
It summarize statistical results based on the packets transmitted, packets received, packet loss, typically including the min/avg/max times.
```
# ping -c 2 2daygeek.com | head -2 | tail -1 | awk '{print $5}' | sed 's/[(:)]//g'
104.27.157.177
```
Use the following bash script to find the multiple domain’s IP address.
```
# vi /opt/scripts/ping-command.sh
#!/bin/bash
for server in `cat /opt/scripts/domains-list.txt`
do echo $server "-"
ping -c 2 $server | head -2 | tail -1 | awk '{print $5}' | sed 's/[(:)]//g'
done | paste -d " " - -
```
Once the above script is added to a file. Set the executable permission for the “dig-command.sh” file.