Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

my ip

# Print my public IP
dig +short myip.opendns.com @resolver1.opendns.com
# Output
77.122.128.246

# Store IP in Bash Variable
myip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
Source by www.cyberciti.biz #
 
PREVIOUS NEXT
Tagged: #ip
ADD COMMENT
Topic
Name
2+8 =