IP to Name Resolution

James Willard james at whispering.org
Fri Apr 7 17:06:27 GMT 2000

I don't suppose there's any way to grab the hostname from the IP address, is
there? It would be nice to be able to reverse resolve the name from the IP
using gethostbyaddr(). Currently, I have hacked up something which calls
nmblookup and grabs the <20> machine name from the output.

On a similar note, is there also a way to grab the whole <03> username field
from a given IP or machine name? Nmblookup truncates the display at 15
characters. I have tried perusing the source to change that output, but
since I'm not very proficient with C, I couldn't find what I needed.
Ideally, another utility that doesn't require parsing nmblookup output would
be best.


James Willard
james at whispering.org

----- Original Message -----
From: "Tim Potter" <tpot at linuxcare.com.au>
To: "Multiple recipients of list SAMBA-TECHNICAL"
<samba-technical at samba.org>
Sent: Friday, April 07, 2000 12:33 AM
Subject: Re: IP to Name Resolution

> Les Kadlof writes:
> > I attended the Sydney Linux Open Source Conference this year and spoke
> > Andrew Tridgell regarding our WINS Server problem we've been having and
> > suggested that I should e-mail you guys.
> >
> > We are trying to develop a driver for Linux 6.1 that can resolve IP to
> > hostnames using various name resolution servers (one of them is a WINS
> > Server). Andrew told me that you guys had some hacked up source code
> > could query the WINS server and return NETBIOS names.
> >
> > Can someone point me into an FTP site or somewhere where I can find the
> > files I need?
> Check out the latest HEAD branch from the cvs repository.  The
> source/nsswitch directory has a wins.c module which may do what
> you want.
> Tim.

More information about the samba-technical mailing list