64
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

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

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

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

便利。

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
Sign upLogin
64
Help us understand the problem. What are the problem?