Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
63
Help us understand the problem. What is going on with this article?
@kuwa_tw

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

More than 5 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

便利。

63
Help us understand the problem. What is going on with this article?
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
kuwa_tw

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
63
Help us understand the problem. What is going on with this article?