68
63

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Last updated at Posted at 2015-07-03

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

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

便利。

68
63
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
68
63

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?