Last active
February 20, 2017 02:20
-
-
Save 5argon/ed0b3e7f1dd61411000e4e17a39ae63e to your computer and use it in GitHub Desktop.
Get an SRV record's port number + target from a URL. (OSX/Linux, or maybe Windows if you have grep) Separated by a whitespace.
This file contains hidden or 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
URL=$1 | |
nslookup -type=SRV $URL | grep -Eo "service.*" | grep -Eo "[0-9]*[ ][^ ]*$" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example :
./srvport.sh mmnssh.5argon.info
Returns
6560 r.5argon.info.