Help us understand the problem. What is going on with this article?

自分のサーバのGlobalIPが知りたい

More than 3 years have passed since last update.

毎回おなじこと調べちゃうシリーズ。

ifconfig.io使いましょ。

 $ curl ifconfig.io
 192.0.2.100

他にもこういうのが取れるみたい

Simple cURL API!
$ curl ifconfig.io
192.0.2.100
$ curl ifconfig.io/ip
192.0.2.100
$ curl ifconfig.io/host
www.example.com.
$ curl ifconfig.io/country_code
JP
$ curl ifconfig.io/ua
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Firefox/38.0
$ curl ifconfig.io/port
37038
$ curl ifconfig.io/lang
en-US,en;q=0.5
$ curl ifconfig.io/encoding
gzip
$ curl ifconfig.io/mime
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
$ curl ifconfig.io/forwarded
192.0.2.100
$ curl ifconfig.io/all
$ curl ifconfig.io/all.xml
$ curl ifconfig.io/all.json

便利。

kuwa_tw
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした