how to find my external IP

Discussion in 'Java' started by nescafe, Mar 26, 2012.

  1. nescafe

    nescafe Guest

    I need to develop one program which will:
    - find my external IP address
    - save this address into some string
    - write this address into one file.


    Any idea what should i use ( for first two options ) ?

    Regards!
     
    nescafe, Mar 26, 2012
    #1
    1. Advertising

  2. nescafe

    Daniel Pitts Guest

    On 3/26/12 5:23 AM, nescafe wrote:
    > I need to develop one program which will:
    > - find my external IP address
    > - save this address into some string
    > - write this address into one file.
    >
    >
    > Any idea what should i use ( for first two options ) ?
    >
    > Regards!


    Read:
    http://www.whatismyip.com/faq/automation.asp

    After reading this, the easiest thing to do is use the "curl" command
    (for unix based OSes, including MacOS). You would curl the automation
    URL (that is linked to from the above page) and redirect the output to
    the file. Note, I'm not providing the direct link, because
    whatismyip.com has specific TOS requirements.

    The other perhaps more reliable but more difficult solution is to
    "scrape" your routers admin pages. This works until you change routers,
    or your router-firmware makes a change that isn't compatible with your
    scraping. YMMV. whatismyip.com is fairly canonical.
     
    Daniel Pitts, Mar 26, 2012
    #2
    1. Advertising

  3. nescafe

    Arne Vajhøj Guest

    On 3/26/2012 8:23 AM, nescafe wrote:
    > I need to develop one program which will:
    > - find my external IP address
    > - save this address into some string
    > - write this address into one file.
    >
    >
    > Any idea what should i use ( for first two options ) ?


    To get the external IP address you need to ask a service
    on the outside.

    Such services exist, but you can also deploy your own
    on some free/cheap server somewhere.

    Arne
     
    Arne Vajhøj, Mar 27, 2012
    #3
  4. nescafe

    Roedy Green Guest

    On Mon, 26 Mar 2012 14:23:18 +0200, nescafe <> wrote, quoted
    or indirectly quoted someone who said :

    >I need to develop one program which will:
    >- find my external IP address
    >- save this address into some string
    >- write this address into one file.


    see http://mindprod.com/jgloss/ip.html
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    When you were a child, if you did your own experiment
    to see if it was better to put to cocoa into your cup first
    or the hot milk first, then you likely have the programmer gene..
     
    Roedy Green, Mar 27, 2012
    #4
  5. nescafe

    Arne Vajhøj Guest

    On 3/27/2012 12:14 AM, Roedy Green wrote:
    > On Mon, 26 Mar 2012 14:23:18 +0200, nescafe<> wrote, quoted
    > or indirectly quoted someone who said :
    >
    >> I need to develop one program which will:
    >> - find my external IP address
    >> - save this address into some string
    >> - write this address into one file.

    >
    > see http://mindprod.com/jgloss/ip.html


    Which does not really provide anything for external IP address ...

    Arne
     
    Arne Vajhøj, May 6, 2012
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Allen
    Replies:
    8
    Views:
    10,984
    Scott Allen
    May 2, 2004
  2. Wybo Dekker
    Replies:
    1
    Views:
    379
    Yukihiro Matsumoto
    Nov 15, 2005
  3. vdvorkin
    Replies:
    0
    Views:
    424
    vdvorkin
    Feb 10, 2011
  4. vdvorkin
    Replies:
    3
    Views:
    832
    vdvorkin
    Feb 14, 2011
  5. Mellow Crow
    Replies:
    6
    Views:
    425
    Richard Cornford
    Nov 4, 2005
Loading...

Share This Page