Curl what is my ip




















This method is inherently faster be it only by a few milliseconds! Default: A. Improve this answer. Timo Tijhof Timo Tijhof 6, 3 3 gold badges 14 14 silver badges 12 12 bronze badges. Krinkle that's an excellent answer. Is there an equivalent for myip. See askubuntu. Please note that in some cases the routers that provide NAT will also translate DNS responses you can take a look at wiki.

Show 21 more comments. Best average ping times: DNS For a comparison here are times that other methods take - tested on from Warsaw and Amsterdam. Using Telnet Telnet with nc or telnet command see above usually takes: 0. FTP 0. Comments If you see some interesting results from your location, or if you think that some other hosts should be recommended instead of those that I've chosen, please post a comment. Timo Tijhof 6, 3 3 gold badges 14 14 silver badges 12 12 bronze badges.

Did you benchmark the myip. Currently it seems that it's winner-by-default due to being unaware of any other providers for this method, but it would still be useful to compare with the other methods. JamesHaigh Thanks for the suggestion. I added DNS and other methods telnet, ftp to the answer. The fastest method seems to be DNS using directly the IP address instead of the domain name of the resolver. You can add myip.

I built this myself as I wasn't particularly satisfied with any of the others I had seen at the time. How can I decide which one is correct? Show 4 more comments. Community Bot 1. Maciek Sawicki Maciek Sawicki 1, 1 1 gold badge 10 10 silver badges 5 5 bronze badges. MaciekSawicki Is the -s option really necessary in this case?

Doesn't seem to work anymore via CLI, but going to the webpage from a web browser works. I'm using openSUSE So, I'm afraid this is no longer correct.

Some alternatives: curl ifconfig. Add a comment. Another one: ip. These two support IPv6. JoshLee, note that icanhazip also supports ipv6. Also, a note to the OP, all these curl solutions though valid still depend on an external library libcurl.

Another one: ifcfg. You can use ifconfig. Chris Down k 22 22 gold badges silver badges bronze badges. Deathless Mr. Deathless 1 1 silver badge 3 3 bronze badges. It is extremely slow. I often get response times over 30 seconds, sometimes even over a minute! Sometimes it's half a second which is still a lot , and then it's 15 seconds or so.

This is tested from different locations. See my answer for more info and benchmarks. Got it working with some decent lot of regex magic, but it wasn't easy. Blank output here, although the site works. Any idea why? I am behind a proxy, if that's relevant, but wget icanhazip. Nothing, just exit code 1. Ditto for netcat icanhazip. You will obviously get the IP address of the proxy back, though. HTTP 1. Show 6 more comments. Janus Troelsen 1, 1 1 gold badge 14 14 silver badges 26 26 bronze badges.

Mandar Shinde Mandar Shinde 2, 10 10 gold badges 34 34 silver badges 53 53 bronze badges. It exits at the first reply it gets.

Cannot use http method. I prefer to use curlmyip. Garrett Fogerlie Garrett Fogerlie 3 3 silver badges 9 9 bronze badges. For use in bash —the intent of the OP—, you cannot do without the -s option mentioned in other answers.

IPv6 was introduced to tackle the foreseeable exhaustion of IPv4 addresses in the near future. All the devices connected to the same WiFi have private IP addresses locally identified by the range provided above.

For example, my laptop is connected with the IP address These are private IP addresses, but both would have the same public IP address. The following commands will get you the IP address list to find public IP addresses for your machine:.

Note: Some utilities need to be installed on your system based on the Linux distro you are using. Also, some of the noted commands use a third-party website to get the IP. If you're using Linux, you can find your IP address using some basic desktop utilities. First, go to your Activities screen and type Network for a wired connection or Wi-Fi for wireless. In the Networks settings window, click the Gear icon next to the network you're on.

In this example screenshot, my IPv4 address is They are bound to a specific network. Public addresses are necessary for establishing external connectivity to other networks, most notably the "Worldwide Web" www of the Internet.

A common example ru ydco is a firewall. And yet we haven't run out of addresses. That's because of a concept called PAT, which allows for a single public IP address to be translated from multiple generally all private IP addresses using port numbers.

Here, instead of assigning a public address to each device, a single public address is allocated to the external side, and private addresses are assigned to each device within the internal network. PAT is most widely used in residential wireless routers, which we use to connect to the Internet.

Each router comes with a private IP address, which multiple devices can connect to. Ranges from 0. A private address costs money because they are unique, limited, and accessible from the Internet. Each website has a domain name mapped to a public IP. Using host Utility. If you liked this article, then do subscribe to email alerts for Linux tutorials.

If you have any questions or doubts? Related Posts. You can also use the following command to find out IP address. How about a simple ping or nslookup? Mike Here, we explained how you can get your own public IP address, say on a laptop, from the terminal.

Mike Okay, considering a server using domain name , ping and nslookup can actually work. Zakir Many thanks for sharing this, and for appreciating our work plus always following us.

Got something to say? Join the discussion. Cancel reply Have a question or suggestion?



0コメント

  • 1000 / 1000