What is my IP Address? How do I get my external IP Address in Mac OS X?

Dec 8, 2009 - 12 Comments

The quickest way to get your external IP address in Mac OS X is by launching the Terminal and typing the following command:

curl whatismyip.org

This will report back your IP address by pulling the result from WhatIsMyIP.org. Alternatively, you could view that site in your web browser and also get your external IP address, but that’s not as quick.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: William Pearson in Command Line, How to, Mac OS X

12 Comments

» Comments RSS Feed

  1. Dale says:

    If you have the luxury of installing on the machine you are using, try the IP Widget. http://cip.physik.uni-bonn.de/~maahn/ip.html

  2. Matt says:

    Ha… It returned this result:

    Banned

    You have been banned from this page.
    We’ve put measures in place to keep people from hitting our site at an unreasonable rate.
    We ask that you only hit our site once per every 5 minutes to get your IP address.
    Our system must’ve detected overuse by you and therefore banned you.
    Are you running an automated script to get your IP?
    Once we figure out what caused the ban and get that fixed, we’ll unban you.
    Send questions to banned2 at whatismyip dot com.

    Please set your code to scrape your IP from http://www.whatismyip.com/automation/n09230945.asp

  3. marc says:

    feh… it is not reporting *your* ip address, it is reporting the address used to access the site which may be that of a proxy, a router, or some other NAT device. Depending upon your network setup it could be the address of some device at your isp.

    If you want to see what addresses are actually in use by your machine and have a terminal window open use this pipeline:

    ifconfig | grep inet

    which will get you both ip (inet) and ipv6 (inet6) addresses that are in use by your machine. I have two interfaces in use on my machine and use inet6 in addition to inet. My addresses are:

    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0×1
    inet 127.0.0.1 netmask 0xff000000
    inet6 fe80::21e:c2ff:fe15:f0f6%en0 prefixlen 64 scopeid 0×4
    inet6 2001:5a8:4:910:21e:c2ff:fe15:f0f6 prefixlen 64 autoconf
    inet 208.201.244.209 netmask 0xffffff00 broadcast 208.201.244.255
    inet6 fe80::21e:c2ff:fea3:2733%en1 prefixlen 64 scopeid 0×6
    inet 192.168.168.1 netmask 0xffffff00 broadcast 192.168.168.255
    inet6 2001:5a8:4:911:21e:c2ff:fea3:2733 prefixlen 64 autoconf

    ::1 and 127.0.0.1 are loopback addresses used by all machines.
    fe80:… are internal ipv6 addresses

    • Joshua says:

      Yes and no. Take a typical home or small office set up. You have a router doing NAT with a single public IP. In most instances this is the IP which will be reported by whatismyip.org. Yes, if you are using a proxy, or have some other complexities, the IP reported might not be the Public IP of your router.

      If you run ifconfig on a device which is on a NATted LAN (the most common home, small office set up), then you will ONLY get your LAN IPs. Which probably not what you want.

      So, yeah, it might not give you the address you need, but ifconfig is even less likely to give you that info in most circumstances.

  4. Imulus says:

    You could also visit a browser support website such as Support Details (http://supportdetails.com). You can even send your system details to someone else directly within the interface.

  5. Adi says:

    or just use whatsmyip.net

  6. Carney says:

    I must say i started loving your blog, so here you got my first comment. i”ll keep bugging you. hope you won’t mind

  7. tejji says:

    and the simple way is here – what is my ip address

  8. [...] URL bar and type: vnc:// Hit Return and Screen Sharing will launch immediately. If you specified an IP address it will open to that host immediately, otherwise a window will pop up asking you for the VNC Host [...]

  9. fjvn says:

    nice info

  10. blameitonthesatellite says:

    This doesn’t seem to work anymore, but

    curl bot.whatismyipaddress.com

    Does.

  11. Kcidkcus says:

    Just type ‘curl ifconfig.me’ in the terminal.

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates