you could try something like:

nslookup `hostname`

and parsing out the address from it. When I do this command on all of our
UNIX machines (HP-UX) it always has the fully qualified hostname in the
output. This may depend on the dns servers, but could work for you...


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Martin Moss
Sent: Friday, November 10, 2000 10:54 AM
To: Cornish, Merrill; Philip Newton;
'[EMAIL PROTECTED]'
Subject: RE: Hostname


I've been having a look at the problem, Does it help if the machine that I
run the script on IS the machine who's fully qualified hostname I'm trying
to get.

for example, I'd thought about opening a process to ping hostname(), and
reading the qualified domain from that. Grepping for the domain name that I
want. All addresses will be of the form xxx.xxx.mydomain.com, or
xxx.mydomain.com

Marty



> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Cornish, Merrill
> Sent: Friday 10 November 2000 15:24
> To: Martin Moss; Philip Newton;
> '[EMAIL PROTECTED]'
> Subject: RE: Hostname
>
>
> gerhostbyaddr() _can_ return the information you want, but it
> really depends
> on the name server that answers you.  For example, when I wrote a Perl
> script to convert the IP addresses in our web server access logs,
> most came
> back with the full URL. Some were unresolved.  And a few had single word
> "names" in all upper case which did _not_ sound like machine names.  In
> fact, I asked what they were on this mailing list, but never got a
> satisfactory answer.
>
> Merrill
>
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to