I strongly recommend that you not try to process the HOSTS file directly.
(though, it is possible)

Some day you'll want to switch to DNS (actually, i'm quite surprised that
you aren't using it already) and then the host file method won't work.

Or, someday IBM's going to change the format of the hosts file.  And then
your program won't work.

Instead, use the APIs "gethostbyname" or "gethostbyaddr" to look things
up.  (Let me know if you need an example)   This way, it'll use the system
resolver, which in turn reads the host file for you, and if that fails it
will use any defined DNS servers...

As for determining the OUTQ associated with an IP... I don't have an
answer.  I've never needed this capability...



On Thu, 14 Feb 2002, Hatzenbeler, Tim wrote:
>
> I would like to write a reverseloop up tool, for our help desk...  Sometimes
> a user will call with a printer issue, but won't know the outq name, but
> they do know the IP address of the printer, so I would like to write a
> program that will accept an IP, bounce it against the host ip table, and
> then bounce the returned names against the outq names...
>
> so I have actually 2 questions, is their a table for the ip values, and is
> their a table for the outq that are available...  or at the very least a way
> to print these values to an outfile...
>
> Thanks, tim



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.