From owner-freebsd-questions Sun Dec 5 15:33:43 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mojave.sitaranetworks.com (mojave.sitaranetworks.com [199.103.141.157]) by hub.freebsd.org (Postfix) with ESMTP id 3456C14D23 for ; Sun, 5 Dec 1999 15:33:40 -0800 (PST) (envelope-from grog@mojave.sitaranetworks.com) Message-ID: <19991205183306.03570@mojave.sitaranetworks.com> Date: Sun, 5 Dec 1999 18:33:06 -0500 From: Greg Lehey To: cjclark@home.com, D Tougas Cc: freebsd-questions@FreeBSD.ORG Subject: Re: How do I find where an IP address is from? Reply-To: Greg Lehey References: <19991204163756.A3242@converging.net> <199912050430.XAA47002@cc942873-a.ewndsr1.nj.home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <199912050430.XAA47002@cc942873-a.ewndsr1.nj.home.com>; from Crist J. Clark on Sat, Dec 04, 1999 at 11:30:04PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Saturday, 4 December 1999 at 23:30:04 -0500, Crist J. Clark wrote: > D Tougas wrote, >> Hello, >> >> I am tring to write a script (maybe there is one that already does this...) >> that takes the IP addresses from an apache log file and checks to see >> what parts of the world people are browsing from. I can use nslookup >> to find out what domain an IP address belongs to, but it seems that >> whois no longer gives much information of any value. I would like some >> way to find out what country an IP address or domain name is from, and >> it has to be easy enough to put into a script. Can anyone help me out >> with this, is there some utility that I am missing? > > Dunno how you can do better than 'whois -a ' in a script. $ whois -a 192.109.197.137 Universitaet Karlsruhe (NET-UNIDOBLOCK) NETBLK-UNIDOBLOCK 192.109.0.0 - 192.109.255.0 University of Dortmund (NETBLK-UNIDOBLOCK2D) UNIDOBLOCK2D 192.109.178.0 - 192.109.255.0 $ nslookup 192.109.197.137 Server: apollo.sitaranetworks.com Address: 199.103.141.105 Name: freebie.lemis.com Address: 192.109.197.137 Which looks more accurate to you? To get back to D's question: You can't do that. There's nothing in the output of nslookup or even whois which tells you where the system is located. You might think Germany, based on the output of whois, or the USA, based on the .com domain, but in fact freebie is located in Australia. Greg -- When replying to this message, please copy the original recipients. For more information, see http://www.lemis.com/questions.html Finger grog@lemis.com for PGP public key See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message