ip-address

How do I determine all of my IP addresses when I have multiple NICs?

I have multiple Network Interface Cards on my computer, each with its own IP address. When I use gethostbyname(gethostname()) from Python's (built-in) socket module, it will only return one of them. How do I get the others? ...

Get IP Address of Remote Client with No DNS Entry in VB.Net

I have a Windows forms application running on a terminal server. I need to determine the IP addresses of each client machine. I found a way to retreive the IP address for computers with DNS entries (example below), but several of my thin clients were set up with static IPs and have no DNS name. Is there a way to determine the IP addre...

Know a good IP address Geolocation Service?

I'd like to get your impressions on any ip geolocation (as in IP to location) service services you may have employed? I'm looking for something free or cheap, which shouldn't be unrealistic because I need to make a very small volume of requests. Anything with python bindings would be especially ideal. ...

Unpacking _WTS_CLIENT_ADDRESS.Address in vb.net (retreiving IP address from Terminal Services Client)

I have the following structure: <StructLayout(LayoutKind.Sequential)> _ Public Structure _WTS_CLIENT_ADDRESS Public AddressFamily As Integer <MarshalAs(UnmanagedType.ByValArray, SizeConst:=20)> _ Public Address() As Byte End Structure Which is populated by the following call: Dim _ClientIPA...

Is there native .NET type for CIDR subnets?

It's simple enough to code up a class to store/validate something like 192.168.0.0/16, but I was curious if a native type for this already existed in .NET? I would imagine it would work a lot like IPAddress: CIDR subnet = CIDR.Parse("192.168.0.0/16"); Basically it just needs to make sure you're working with an IPv4 or IPv6 address an...

Adding a Web Domain on Windows Server 2008

Hey I recently purchased a Windows Server 2008 server, Our company will be using it as a Web Server. I have set the web site up in IIS 7.0 and I can accsess it by typing http://10.1.1.8 on the computers within the network. When I try to accsess it through the net on other computers it doesnt seem to work, But most important, How do I ...

Python: packing an ip address as a ctype.c_ulong() for use with DLL

given the following code: import ctypes ip="192.168.1.1" thisdll = ctypes.cdll['aDLL'] thisdll.functionThatExpectsAnIP(ip) how can I correctly pack this for a DLL that expects it as a c_ulong datatype? I've tried using: ip_netFrmt = socket.inet_aton(ip) ip_netFrmt_c = ctypes.c_ulong(ip_netFrmt) however, the c_ulong() method ...

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. ...

C#: Binding a new SoapClient to a specific IP address before sending outgoing request

Hello everyone, Let's say a machine where the application sits on has SoapClient (to be specific, I'm using Microsoft.Web.Service3.Messaging.SoapClient). It communicates toward a remote location with no problem by sending outgoing requests and getting SoapEnvelope in return (well-established process). The above scenario is through the ...

How to get City, Country, and Country Code for a particular IP Address in ASP.NET?

Hi, I am having an application in which i am storing user ip address. But now i want to store the City, Country and Country Code of the user on the basis of their ip addresses. So I am able to get the user's IP Address in ASP.NET but how to get other details. If its possible (which i don't thin it is) then tell me else tell me some alte...

IP address parsing in .NET

I'm using IPAddress.TryParse() to parse IP addresses. However, it's a little too permissive (parsing "1" returns 0.0.0.1). I'd like to limit the input to dotted octet notation. What's the best way to do this? (Note: I'm using .NET 2.0) Edit Let me clarify: I'm writing an app that will scan a range of IPs looking for certain devices...

In Ruby, how does one get their IP octet without going through DNS?

I can, on some of my systems, get my IP address (192.68.m.n format) by doing this: addr = IPSocket::getAddress(Socket.gethostname()) ...the trouble is that this only works if the name the local machine uses for itself is the name the DNS server associates with it. How *&#( hard can it be for ruby to just return its primary interface'...

Why does gethostbyaddr(gethostname()) return my IPv6 IP?

I'm working on making a simple server application with python, and I'm trying to get the IP to bind the listening socket to. An example I looked at uses this: HOST = gethostbyaddr(gethostname()) With a little more processing after this, it should give me just the host IP as a string. This should return the IPv4 address. But when I ru...

What is the easiest way using common linux tools to check if a bunch of ip addresses belongs to given network?

What is the easiest way using common linux tools to check if a bunch of ip addresses belongs to given network? I just need a number of how many of given addresses belongs to given subnet. Lets say network is 192.16.55.40/27 and addresses is 192.16.55.45, 192.16.55.115, 88.87.45.8, 192.16.55.37, 192.16.55.60 and 192.16.55.210.. ...

Special IP addresses

In particular I'm looking for an IP address that I can put in my hosts file that will black-hole a given DNS name. Right now I'm using 127.0.0.1 but that would start acting odd if I installed any services. How can I prevent a 3rd party program from contacting a given server? ...

How to store and search for an IP Address

I have the 4 sources of IP addresses , I want to store them in SQL Server and allow the ranges, that can be categorised by the originating country code, to be maked in an Exclusion list by country. For this I have 2 tables. IPAddressRange CountryCode What I need to know is, if this data was returned to the client then cached for qui...

Doing ARP and Inverse ARP on Linux 2.6.21 (glibc 2.3.5)

I need to store persistent reference to third party device on an arbitrary IP network where the IP address of the devices may be static or randomly assigned by DHCP. I don't control the devices on the network and I can't rely on DNS and other ad-hoc networking protocols existing or working with the devices. So I have been instructed to ...

How do display the Integer value of an IPAddress

I was looking at the System.Net Namespace and it has an IPAddress instance you can use. This has a Parse method which you can use to parse a string into an IPInstance then use the Address property to give you the long value. However... The number returned is NOT the true conversion. e.g. For IP 58.0.0.0 , the System.Net namespace give...

IP Address Logging for Lots of Models in Existing Application

I have an existing app that has many, many models. I'd like to log the IP address of the user that created them with the primary purpose being a way to help weed out spammers or other abusive users (if I don't know what IP address(es) they are using, I can't block it). I would need to keep track of these over time as users may access fro...

How do I find a computer's IP address?

I am writing a program in C++ which uses network sockets. I need to find out what the computer's IP address is, so I can display it to the user. The program must run on Windows and Linux. I have heard somewhere that a computer can have multiple IP addresses. I want the one that other programs on different computers can use to connect to...