Geocode an IP address? [closed]

Another free REST API with city accurate information would be http://freegeoip.net Requests are fairly straight forward. You would use something like http://freegeoip.net/{format}/{ip_or_hostname} to geocode an IP address, where format can be csv, xml or json. Their website has all the details. [UPDATE:] FreeGeoIP.net was not continuously available in the past as a public service. The … Read more

Jersey Grizzly REST service not visible outside localhost

To make a server IP adress visible outside of localhost, you must fist open the neccessary firewall ports(if you have one), or use “0.0.0.0” instead of “localhost” in order for the server to listen to all IP addresses and network adapters. Before testing it in your local network, try pinging your server device from your … Read more

Get Local IP-Address using Boost.Asio

Here’s a trick I learned from python network programming (google) to figure out my machine’s ip address. This only works if you have an internet connection and can connect to google.com and does give me my home machine’s 192.168.x.x private address. try { boost::asio::io_service netService; udp::resolver resolver(netService); udp::resolver::query query(udp::v4(), “google.com”, “”); udp::resolver::iterator endpoints = resolver.resolve(query); … Read more

How do some web services recognize I’m logging in from a new location?

Here are some ideas you may be interested in… As I already said to you it’s not an exact science. You should keep what’s important for security first and consider all this “optional” Plus, remember that all suggested “time durations” are subjective depending on how frenetic are accessess to your site and how strong should … Read more

How to get IP of all hosts in LAN?

You’ll have to do a ping sweep. There’s a Ping class in the System.Net namespace. Example follows. Also this is only possible if your computers don’t have firewalls running. If they’ve got a firewall enabled, there’s no way to determine this information short of doing SNMP queries on your switches. System.Net.NetworkInformation.Ping p = new System.Net.NetworkInformation.Ping(); … Read more

How to find Port number of IP address?

Unfortunately the standard DNS A-record (domain name to IP address) used by web-browsers to locate web-servers does not include a port number. Web-browsers use the URL protocol prefix (http://) to determine the port number (http = 80, https = 443, ftp = 21, etc.) unless the port number is specifically typed in the URL (for … Read more