Questions tagged [ip]

This tag is for questions related to the Internet Protocol. You may want to use the tag [ip-address] instead of or in conjunction with this tag. For questions about intellectual property, use [intellectual-property] instead.

The Internet Protocol is one of the fundamental protocols used for the Internet. There are two main versions: uses 32-bit addresses (often shown in dotted-decimal notation, e.g. 10.0.1.3) and uses 128-bit addresses. IP addresses have their own tag, , which is often seen with . Its companion protocol is the Transmission Control Protocol, , and the combination is often denoted TCP/IP.

This tag is also used infrequently to mean the C language structure related to IP addresses, the computational complexity class IP or instruction pointers. It should not be used to refer to intellectual property; that has its own tag, .

9300 questions
540
votes
6 answers

Maximum length of the textual representation of an IPv6 address?

I want to store the data returned by $_SERVER["REMOTE_ADDR"] in PHP into a DB field, pretty simple task, really. The problem is that I can't find any proper information about the maximum length of the textual representation of an IPv6 address, which…
Gilles
  • 7,183
  • 3
  • 21
  • 24
535
votes
28 answers

How to get the IP address of the docker host from inside a docker container

As the title says, I need to be able to retrieve the IP address the docker hosts and the portmaps from the host to the container, and doing that inside of the container.
xiamx
  • 6,560
  • 5
  • 25
  • 32
512
votes
33 answers

How to determine a user's IP address in node

How can I determine the IP address of a given request from within a controller? For example (in express): app.post('/get/ip/address', function (req, res) { // need access to IP address here })
Shamoon
  • 41,293
  • 91
  • 306
  • 570
482
votes
3 answers

What is the difference between 0.0.0.0, 127.0.0.1 and localhost?

I am using Jekyll and Vagrant on my mac. I found that Jekyll server will bind to 0.0.0.0:4000 instead of 127.0.0.1:4000. Also gem server will bind to this address by default. I can still visit it via http://localhost:port. But for Jekyll, it seems…
Ciel
  • 5,551
  • 5
  • 17
  • 24
437
votes
31 answers

How to get the primary IP address of the local machine on Linux and OS X?

I am looking for a command line solution that would return me the primary (first) IP address of the localhost, other than 127.0.0.1 The solution should work at least for Linux (Debian and RedHat) and OS X 10.7+ I am aware that ifconfig is available…
sorin
  • 161,544
  • 178
  • 535
  • 806
427
votes
43 answers

Get local IP address in Node.js

I have a simple Node.js program running on my machine and I want to get the local IP address of a PC on which my program is running. How do I get it with Node.js?
yojimbo87
  • 65,684
  • 25
  • 123
  • 131
405
votes
16 answers

Express.js: how to get remote client address

I don't completely understand how I should get a remote user IP address. Let's say I have a simple request route such as: app.get(/, function (req, res){ var forwardedIpsStr = req.header('x-forwarded-for'); var IP = ''; if…
Erik
  • 14,060
  • 49
  • 132
  • 218
352
votes
3 answers

How to get a list of all valid IP addresses in a local network?

Is there a way to get a list of all valid IP addresses in a local network? I mean all IP addresses that each user is using in the network.
M.J.Ahmadi
  • 3,931
  • 4
  • 17
  • 24
343
votes
19 answers

Getting the IP address of the current machine using Java

I am trying to develop a system where there are different nodes that are run on different system or on different ports on the same system. Now all the nodes create a Socket with a target IP as the IP of a special node known as a bootstrapping node.…
sasidhar
  • 7,523
  • 15
  • 49
  • 75
306
votes
32 answers

Kubernetes service external ip pending

I am trying to deploy nginx on kubernetes, kubernetes version is v1.5.2, I have deployed nginx with 3 replica, YAML file is below, apiVersion: extensions/v1beta1 kind: Deployment metadata: name: deployment-example spec: replicas: 3 …
Pankaj Jackson
  • 3,521
  • 3
  • 15
  • 19
266
votes
34 answers

Getting visitors country from their IP

I want to get visitors country via their IP... Right now I'm using this (http://api.hostip.info/country.php?ip=...... ) Here is my code:
Alex C.
  • 4,021
  • 4
  • 21
  • 24
219
votes
2 answers

Linux command to translate domain name to IP

Is there any Linux command to translate a domain name to an IP address?
Frank
  • 7,235
  • 9
  • 46
  • 56
209
votes
20 answers

Getting the location from an IP address

I want to retrieve information like the city, state, and country of a visitor from their IP address, so that I can customize my web page according to their location. Is there a good and reliable way to do this in PHP? I am using JavaScript for…
krishna Kant
153
votes
3 answers

What is IP address '::1'?

I was playing with sockets on local machine with no network connection. See below: IPAddress address = IPAddress.Any; // doesn't work IPAddress address = IPAddress.Parse("::1"); // works So what is exactly ::1 IP address ? Is it the default…
Xaqron
  • 29,931
  • 42
  • 140
  • 205
137
votes
18 answers

How to identify server IP address in PHP

How can I identify the server IP address in PHP?
pooja
  • 2,334
  • 3
  • 16
  • 16
1
2 3
99 100