欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

詳解幾種Linux 查詢外網(wǎng)出口IP命令的方法

 更新時間:2017年03月16日 09:28:28   作者:Felix運維  
本篇文章主要介紹了詳解幾種Linux 查詢外網(wǎng)出口IP的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

Curl 純文本格式輸出:

curl icanhazip.com
curl ifconfig.me
curl curlmyip.com
curl ip.appspot.com
curl ipinfo.io/ip
curl ipecho.net/plain
curl www.trackip.net/i

curl JSON格式輸出:

curl ipinfo.io/jsoncurl ifconfig.me/all.jsoncurl www.trackip.net/ip?json 

curl XML格式輸出:

curl ifconfig.me/all.xml

curl 得到所有IP細節(jié) (挖掘機)

curl ifconfig.me/all

使用 DYDNS (當你使用 DYDNS 服務(wù)時有用)

curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g'
curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+" 

使用 Wget 代替 Curl

wget http://ipecho.net/plain -O - -q ; echo
wget http://observebox.com/ip -O - -q ; echo

使用 host 和 dig 命令

如果有的話,你也可以直接使用 host 和 dig 命令。

host -t a dartsclink.com | sed 's/.*has address //'
dig +short myip.opendns.com @resolver1.opendns.com 

bash 腳本示例:

#!/bin/bash
PUBLIC_IP=`wget http://ipecho.net/plain -O - -q ; echo`
echo $PUBLIC_IP

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論