Last active
November 14, 2023 05:19
-
-
Save mapi68/9cdb340319a15a94ba1f33f23109a408 to your computer and use it in GitHub Desktop.
This Bash script prompts the user to input a DNS name, and then uses the dig command to retrieve and display the corresponding IP address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tput clear | |
echo | |
echo "********************* Hello $USER! *********************" | |
echo | |
echo "Please paste DNS name that you want to convert into IP:" | |
read A | |
echo | |
echo "IP of $A is: `dig $A | awk '/^;; ANSWER SECTION:$/ { getline ; print $5 }'`" | |
echo | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment