Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Reply-To: From: "Francis Litterio" To: "'C. Porter Bassett'" , Subject: RE: IP Lookup command Date: Thu, 31 May 2001 13:52:05 -0400 Message-ID: <000f01c0e9fa$6866fe90$4500f98c@EMMAROSE> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal In-Reply-To: <001c01c0e9f5$dc233c90$0a00a8c0@PWORK> Try this quick hack. It works for me under Cygwin 1.3.1: #include #include int main(int argc, char * argv[]) { char ** addrlistelem; struct hostent * hostinfo; hostinfo = gethostbyname(argv[1]); if (hostinfo == NULL) { fputs("unknown host\n", stderr); exit(1); } addrlistelem = hostinfo->h_addr_list; while (*addrlistelem) { char * address = *addrlistelem; printf("%u.%u.%u.%u\n", address[0] & 0xff, address[1] & 0xff, address[2] & 0xff, address[3] & 0xff); addrlistelem++; } exit(0); } -----Original Message----- From: cygwin-owner AT sources DOT redhat DOT com [mailto:cygwin-owner AT sources DOT redhat DOT com]On Behalf Of C. Porter Bassett Sent: Thursday, May 31, 2001 1:20 PM To: cygwin AT cygwin DOT com Subject: IP Lookup command I need a command that I can call in the following manner: $ unknown_command host_on_my_network 192.168.20.119 $ At least here on my network, neither nslookup nor host work, although they will go outside of my network and work just fine. Ping manages to find local computers in the way that I am looking for. Should I just pass ping though some filter? -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple