An Internet Protocol address (IP address) is a numerical label assigned to each device in a computer network that uses the Internet Protocol for communication. This is a general tag that covers both IPv4 (like 172.168.100.1) and the newer IPv6 (like 2012:da8:0:1234:7:577:8:2). If you specifically mean any of these, use IPv4 or IPv6 tags.
Questions tagged [ip-address]
3875 questions
191
votes
6 answers
Rails: Get Client IP address
In Rails, what's the best way to get the ip address of the client connecting to the server?
Here are two ways I've found:
request.remote_ip
request.env['HTTP_X_REAL_IP']

ma11hew28
- 121,420
- 116
- 450
- 651
185
votes
11 answers
How to validate IP address in Python?
What's the best way to validate that an IP entered by the user is valid? It comes in as a string.

krupan
- 3,920
- 5
- 27
- 24
182
votes
36 answers
Which terminal command to get just IP address and nothing else?
I'm trying to use just the IP address (inet) as a parameter in a script I wrote.
Is there an easy way in a unix terminal to get just the IP address, rather than looking through ifconfig?

Mason
- 6,893
- 15
- 71
- 115
148
votes
22 answers
Get the client's IP address in socket.io
When using socket.IO in a Node.js server, is there an easy way to get the IP address of an incoming connection? I know you can get it from a standard HTTP connection, but socket.io is a bit of a different beast.

Toji
- 33,927
- 22
- 105
- 115
143
votes
11 answers
How to extract IP Address in Spring MVC Controller get call?
I am working on Spring MVC controller project in which I am making a GET URL call from the browser -
Below is the url by which I am making a GET call from the browser -
http://127.0.0.1:8080/testweb/processing?workflow=test&conf=20140324&dc=all
And…

john
- 11,311
- 40
- 131
- 251
139
votes
30 answers
How can I check if an ip is in a network in Python?
Given an ip address (say 192.168.0.1), how do I check if it's in a network (say 192.168.0.0/24) in Python?
Are there general tools in Python for ip address manipulation? Stuff like host lookups, ip adddress to int, network address with netmask to…

Staale
- 27,254
- 23
- 66
- 85
130
votes
9 answers
Can You Get A Users Local LAN IP Address Via JavaScript?
I know the initial reaction to this question is "no" and "it can't be done" and "you shouldn't need it, you are doing something wrong". What I'm trying to do is get the users LAN IP address, and display it on the web page. Why? Because that's what…

l008com
- 1,699
- 2
- 11
- 20
127
votes
10 answers
How to get my IP address programmatically on iOS/macOS?
I would like to obtain my iPad's IP address programmatically.
How can I query the networking subsystem to find out what my IPv4 (and IPv6) addresses are?
PS: Can I disable IPv6 somehow?

Wilbur
- 1,333
- 3
- 10
- 5
127
votes
12 answers
Datatype for storing ip address in SQL Server
What datatype should I choose for storing an IP Address in a SQL Server?
By selecting the right datatype would it be easy enough to filter by IP address then?

OrElse
- 9,709
- 39
- 140
- 253
113
votes
22 answers
PHP how to get local IP of system
I need to get local IP of computer like 192.*....
Is this possible with PHP?
I need IP address of system running the script, but I do not need the external IP, I need his local network card address.

air
- 6,136
- 26
- 93
- 125
112
votes
13 answers
CloudFlare and logging visitor IP addresses via in PHP
I'm trying to track and log users/visitors that are accessing my website using PHP's $_SERVER['REMOTE_ADDR'] to do so. A typical method for IP address tracking in PHP.
However, I am using CloudFlare for caching and such and receiving their IP…

tfont
- 10,891
- 7
- 56
- 52
109
votes
3 answers
What is the meaning of SO_REUSEADDR (setsockopt option) - Linux?
From the man page:
SO_REUSEADDR Specifies that the rules
used in validating addresses supplied
to bind() should allow reuse of local
addresses, if this is supported by the
protocol. This option takes an int
value. This is a Boolean…

Ray Templeton
- 1,091
- 2
- 8
- 3
103
votes
3 answers
Which MySQL datatype to use for an IP address?
Possible Duplicate:
How to store an IP in mySQL
I want to get the IP address from $_SERVER['REMOTE_ADDR'] and some other $_SERVER variables, which datatype is the right one for this?
Is it VARCHAR(n)?

ComFreek
- 29,044
- 18
- 104
- 156
101
votes
11 answers
How to convert string to IP address and vice versa
how can I convert a string ipAddress (struct in_addr) and vice versa?
and how do I turn in unsigned long ipAddress?
thanks

Safari
- 11,437
- 24
- 91
- 191
101
votes
12 answers
How can I get the IP address of a (Linux) machine?
This Question is almost the same as the previously asked How can I get the IP Address of a local computer? -Question. However I need to find the IP address(es) of a Linux Machine.
So: How do I - programmatically in C++ - detect the IP addresses of…

BlaM
- 28,465
- 32
- 91
- 105