Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default hostname

    Is there away to find all of the hostname on a lan with use of perl?



    Thanks,



    Thomas




    Thomas Browner Guest

  2. Similar Questions and Discussions

    1. IP and hostname comparing
      Anyone who can help me with a IP thingie? I want to compare a IP adress with a IP "String" with wildcards (*) like 127.0.0.1 equals to 127.*.*.*...
    2. hostname for LWP
      Hi - I just installed perl-5.8.0 from source, in the shell (perl -MCPAN -e shell) I tried to "install LWP" but had some problems until I added...
    3. hostname change
      Hello, I would like to change to hostname of a Solaris 8 server and therefore I have modified /etc/hosts and /etc/hostname.hme0 to match the new...
    4. hostname is not correct
      When I attempt to send mail, from the command line, the address after the "@" is knoppix. After I installed knoppinx to the hard drive, I've...
    5. Sendmail 8.9.3 - need to remove hostname from @hostname.domain.com
      I just upgraded from 432 to 433. Along with this came Sendmail8.9.3. I have changed the new sendmail.cf file with the same changes as the previous...
  3. #2

    Default [First Response Service] Re: hostname

    Hi.

    I'm in the employ of Casey West, a list admin, to assist you with your
    question. I've taken the liberty to search Google using the Subject line
    you provided in your email to the list. I hope one of the links below
    will be of service to you.

    Sadly Google hasn't given us a nice, legal API for searching newsgroups,
    so you may also want to try these searches.

    [url]http://groups.google.com/groups?q=Perl+hostname[/url]
    [url]http://groups.google.com/groups?q=hostname+group%3Acomp.lang.perl.*[/url]

    If you didn't get any useful results below, there's a chance your
    Subject line was not specific enough, or not detailed enough. For
    example, the following subject lines are not very good choices.

    Subject: Doubt
    Subject: HELP!
    Subject: Problem

    On the other hand, it's possible that your question is unique, or the
    search needs a human touch to get just the right results.

    Enjoy!

    Perl.org Beginners' Lists, 7 results.
    Searched: site:nntp.x.perl.org inurl:perl.beginners -inurl:show_headers hostname

    [1] nntp.perl.org - perl.beginners (54768)
    [url]http://nntp.x.perl.org/group/perl.beginners/54768[/url]
    ... Previous | Next | Toggle headers Newsgroups: perl.beginners
    Message-ID: <3FA32B75 ... Maybe something like this: > > %commands
    = ('sol'=>{'hostname' => [1,'uname -n ...

    [2] nntp.perl.org - perl.beginners (54781)
    [url]http://nntp.x.perl.org/group/perl.beginners/54781[/url]
    ... Previous | Next | Toggle headers Newsgroups: perl.beginners
    Message-ID ... Maybe something like this: > > %commands =
    ('sol'=>{'hostname' => [1,'uname -n'], > 'os ...

    [3] nntp.perl.org - perl.beginners (54759)
    [url]http://nntp.x.perl.org/group/perl.beginners/54759[/url]
    ... Previous | Next | Toggle headers Newsgroups: perl.beginners
    Message-ID: <049FA0234069D945B133B9B4FB64C77501E69B92 ... print
    $1}' | wc -l Command: hostname uname -n ...

    [4] nntp.perl.org - perl.beginners (54763)
    [url]http://nntp.x.perl.org/group/perl.beginners/54763[/url]
    ... Previous | Next | Toggle headers Newsgroups: perl.beginners
    Message-ID ... Maybe something like this: %commands =
    ('sol'=>{'hostname' => [1,'uname -n'], 'os' => [2 ...

    [5] nntp.perl.org - perl.beginners (54762)
    [url]http://nntp.x.perl.org/group/perl.beginners/54762[/url]
    ... Previous | Next | Toggle headers Newsgroups: perl.beginners
    Message-ID: <3FA2EEFD ... commands, "Tie::IxHash"; >> >commands =
    ('sol'=>{'hostname' =>'uname -n ...

    [6] nntp.perl.org - perl.beginners (54758)
    [url]http://nntp.x.perl.org/group/perl.beginners/54758[/url]
    ... Previous | Next | Toggle headers Newsgroups: perl.beginners
    Message-ID ... > > tie my %commands, "Tie::IxHash"; > > >commands
    = ('sol'=>{'hostname' =>'uname -n ...

    [7] nntp.perl.org - perl.beginners (45405)
    [url]http://nntp.x.perl.org/group/perl.beginners/45405[/url]
    ... Previous | Next | Toggle headers Newsgroups: perl.beginners
    Message-ID ... my $remote = IO::Socket::INET->new( > PeerAddr =>
    "server hostname", > PeerPort => "9284 ...

    Perl.org Lists, 10 results.
    Searched: site:nntp.x.perl.org -inurl:show_headers hostname

    [1] nntp.perl.org - perl.cpan.testers (97786)
    [url]http://nntp.x.perl.org/group/perl.cpan.testers/97786[/url]
    ... 9 Aug 2003 05:25:21 -0000 Message-ID:
    <20030809052521.14086.qmail@sunu991.rz.ruhr-uni-bochum.de> Cc:
    MIKER[at]cpan.org Subject: FAIL Sys-Hostname-FQDN-0.02 sun4 ...

    [2] nntp.perl.org - perl.cpan.testers (97820)
    [url]http://nntp.x.perl.org/group/perl.cpan.testers/97820[/url]
    ... 05:58 -0700 (PDT) To: Josts Smokehouse
    <Jost.Krieger+smokeback[at]ruhr-uni-bochum.de> cc:
    <cpan-testers[at]perl.org> Subject: Re: FAIL
    Sys-Hostname-FQDN-0.02 ...

    [3] nntp.perl.org - perl.qpsmtpd (626)
    [url]http://nntp.x.perl.org/group/perl.qpsmtpd/626[/url]
    ... lc($recipient->host); use IO::Socket; foreach my $hostname (
    @check_vrfy ) { if ($hostname =~ /^(w]+)$/hostname = $1; # cleanse
    the taint } my $VRFY ...

    [4] nntp.perl.org - perl.daily.news (767)
    [url]http://nntp.x.perl.org/group/perl.daily.news/767[/url]
    ... [25]Net-MDNS-Server-0.03 -- Perl extension for a multicast DNS
    server * [26]PAR-0.75 -- Perl Archive Toolkit *
    [27]Sys-Hostname-FQDN-0.05 -- Get the short or ...

    [5] nntp.perl.org - perl.beginners (54768)
    [url]http://nntp.x.perl.org/group/perl.beginners/54768[/url]
    ... Maybe something like this: > > %commands = ('sol'=>{'hostname'
    => [1,'uname -n'], > 'os' => [2,'uname -s'], > 'osver' =>
    [3,'uname -r'], > 'osrel' => [4,'cat ...

    [6] nntp.perl.org - perl.dbi.users (21008)
    [url]http://nntp.x.perl.org/group/perl.dbi.users/21008[/url]
    ... JDBC Proxy Sponge DBI 1.38-nothread dispatch trace level set
    to 2 DEBUG: connecting to JDBC using this conn string --
    dbi:JDBC:hostname=lintest.somedomain.com ...

    [7] nntp.perl.org - perl.perl4lib (1487)
    [url]http://nntp.x.perl.org/group/perl.perl4lib/1487[/url]
    ... The cookbook also suggested the below. This works securely.
    +60 use POSIX qw(uname); +61 ($k, $h, $r, $v, $h) = uname(); +62
    $hostname = (uname)[1]; Brad ...

    [8] nntp.perl.org - perl.perl6.language.flow (314)
    [url]http://nntp.x.perl.org/group/perl.perl6.language.flow/314[/url]
    ... Module A's use of B may have nasty interactions with C's use
    of B. PRL> =item C<Sys::Hostname> PRL> C<Sys::Hostname> gets the
    system hostname and caches it in ...

    [9] nntp.perl.org - perl.poe (1955)
    [url]http://nntp.x.perl.org/group/perl.poe/1955[/url]
    ... strict; use warnings; use POE qw(Wheel::Run
    Filter::Reference); use YAML; use Net::LDAP; use Time::HiRes qw(
    time ); use Getopt::Long; my $hostname = 'auth.your ...

    [10] nntp.perl.org - perl.perl4lib (1485)
    [url]http://nntp.x.perl.org/group/perl.perl4lib/1485[/url]
    ... The homegrown package (I made successfully!) among several
    things tried to run this: $host = `hostname`; ...and of course it
    failed with this message in ...

    search.cpan.org, 10 results.
    Searched: site:search.cpan.org hostname

    [1] search.cpan.org: Sys::Hostname - Try every conceivable way to get ...
    [url]http://search.cpan.org/search%3Fmodule=Sys::Hostname[/url]
    Nicholas Clark > perl-5.8.2 > Sys::Hostname. Module Version: 1.11
    Source Latest Release: perl-5.6.2: ... Sys::Hostname - Try every
    conceivable way to get hostname. ...

    [2] search.cpan.org: Michael Robinton / Sys-Hostname-FQDN-0.06
    [url]http://search.cpan.org/~miker/Sys-Hostname-FQDN-0.06/[/url]
    Michael Robinton > Sys-Hostname-FQDN-0.06. Sys-Hostname-FQDN-0.06.
    This Release, Sys-Hostname-FQDN ... Modules. Sys::Hostname::FQDN,
    Get the short or long hostname, 0.06.

    [3] search.cpan.org: Sys::Hostname::Long - Try every conceivable way ...
    [url]http://search.cpan.org/search%3Fmodule=Sys::Hostname::Long[/url]
    Scott Penrose > Sys-Hostname-Long-1.0 > Sys::Hostname::Long.
    Module Version: 1.0 Source: ... Sys::Hostname::Long - Try every
    conceivable way to get full hostname. ...

    [4] search.cpan.org: Scott Penrose / Sys-Hostname-Long-1.0
    [url]http://search.cpan.org/~scott/Sys-Hostname-Long-1.0/[/url]
    Scott Penrose > Sys-Hostname-Long-1.0. Sys-Hostname-Long-1.0. This
    Release, Sys-Hostname ... Sys::Hostname::Long, Try every
    conceivable way to get full hostname, 1.0.

    [5] search.cpan.org: Scott Penrose / Sys-Hostname-Long
    [url]http://search.cpan.org/dist/Sys-Hostname-Long/[/url]
    Scott Penrose > Sys-Hostname-Long. Sys-Hostname-Long. This
    Release, Sys-Hostname ... Modules. Sys::Hostname::Long, Try every
    conceivable way to get full hostname, 1.0.

    [6] Index of /src/SCOTT/Sys-Hostname-Long-1.0
    [url]http://search.cpan.org/src/SCOTT/Sys-Hostname-Long-1.0/[/url]
    Index of /src/SCOTT/Sys-Hostname-Long-1.0. Name Last modified Size
    Parent Directory - Changes 26-Aug-2001 04:53 89 MANIFEST 19-Sep
    ...

    [7] Index of /src/SCOTT/Sys-Hostname-Long-1.0/lib/Sys/Hostname
    [url]http://search.cpan.org/src/SCOTT/Sys-Hostname-Long-1.0/lib/Sys/Hostname/[/url]
    Index of /src/SCOTT/Sys-Hostname-Long-1.0/lib/Sys/Hostname. Name
    Last modified Size Parent Directory - Long.pm 22-Sep-2001 01:23
    2.4K ...

    [8] Index of /src/MIKER/Sys-Hostname-FQDN-0.06
    [url]http://search.cpan.org/src/MIKER/Sys-Hostname-FQDN-0.06/[/url]
    Index of /src/MIKER/Sys-Hostname-FQDN-0.06. Name Last modified
    Size Parent Directory - Changes 20-Sep-2003 18:07 584 FQDN.pm
    20-Sep ...

    [9] Index of /src/SCOTT/Sys-Hostname-Long-1.0/lib/Sys
    [url]http://search.cpan.org/src/SCOTT/Sys-Hostname-Long-1.0/lib/Sys/[/url]
    Index of /src/SCOTT/Sys-Hostname-Long-1.0/lib/Sys. Name Last
    modified Size Parent Directory - Hostname/ 06-May-2002 09:06 - ...

    [10] search.cpan.org: Michael Robinton / Sys-Hostname-FQDN
    [url]http://search.cpan.org/dist/Sys-Hostname-FQDN/[/url]
    Michael Robinton > Sys-Hostname-FQDN. Sys-Hostname-FQDN. This
    Release, Sys-Hostname-FQDN-0.06, ... Modules. Sys::Hostname::FQDN,
    Get the short or long hostname, 0.06.

    Google Search, 10 results.
    Searched: Perl hostname

    [1] libwww-perl Mailing List Archive for 1995 (second half): libwww- ...
    [url]http://ftp.ics.uci.edu/pub/websoft/libwww-perl/archive/1995h2/0185.html[/url]
    libwww-perl: hostname.pl problem. Caleb ... problem"; Maybe reply:
    [email]Nick.Ing-Simmons@tiuk.ti.com[/email]: "Re: libwww-perl: hostname.pl
    problem"; ...

    [2] libwww-perl Mailing List Archive for 1995 (second half): Re: ...
    [url]http://ftp.ics.uci.edu/pub/websoft/libwww-perl/archive/1995h2/0177.html[/url]
    Re: libwww-perl: hostname.pl problem. Roy ... Next message:
    [email]Nick.Ing-Simmons@tiuk.ti.com[/email]: "Re: libwww-perl: hostname.pl
    problem"; Previous ...

    [3] Yahoo! Groups : libwww-perl Messages : Message 498 of 7559
    [url]http://groups.yahoo.com/group/libwww-perl/message/498[/url]
    ... Msg #. From: "Caleb.Kwok" <KWOKC@c...> Date: Mon Sep 11, 1995
    5:59 pm Subject: libwww-perl: hostname.pl problem. Date: Monday,
    11 ...

    [4] Yahoo! Groups : libwww-perl Messages : 501-600 of 7559
    [url]http://groups.yahoo.com/group/libwww-perl/messages/501?viscount=100[/url]
    ... ID, Date, 501, Re: libwww-perl: hostname.pl problem,
    Nick.Ing-Simmons@t... Tue 9/12/1995, 502, Re: libwww-perl:
    hostname.pl problem, Gisle Aas, Tue 9/12/1995, ...

    [5] Use Hostname, DNS Problem ?
    [url]http://opop.nols.com/proggie/dopewars.pl[/url]
    Version for perl with instructions in the code. [Open Source, GPL]

    [6] The CGI Resource Index: Programs and Scripts: Perl: Redirection: ...
    [url]http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Redirection/Hostname_Based/[/url]
    ... Survey Software Run web-based surveys on your site! View demo;
    PHP or Perl/CGI. FormMail.com Results of web forms sent to your
    inbox for under $1/month! ...

    [7] HotScripts.com :: CGI and Perl Scripts and Programs :: ...
    [url]http://www.hotscripts.com/CGI_and_Perl/Scripts_and_Programs/Redirection/Hostname_Based/[/url]
    A comprehensive collection of 19 CGI and Perl Redirection Hostname
    Based Scripts & Applications! Last Updated April 9th, 2000. ...

    [8] RPM Search perl-Sys-Hostname-FQDN-0.04-1.i586.rpm
    [url]http://rpm.pbone.net/index.php3/stat/4/idpl/723664/com/perl-Sys-Hostname-FQDN-0.04-1.i586.rpm.html[/url]
    Name : perl-Sys-Hostname-FQDN, Version : 0.04, Vendor : PLD. ...
    Group : Development/Languages/perl, Source RPM :
    perl-Sys-Hostname-FQDN-0.04-1.src.rpm. Size : 17159, ...

    [9] Installing Perl 5.8: hostname test fails
    [url]http://www.mail-archive.com/macosx@perl.org/msg05293.html[/url]
    ... Installing Perl 5.8: hostname test fails. From: Alexander von
    Below; Subject: InstallingPerl 5.8: hostname test fails; Date:
    Thu, 19 Jun 2003 15:20:00 -0700. ...

    [10] ! Aware to Perl: How do I find out my hostname/domainname/IP ...
    [url]http://www.rocketaware.com/perl/perlfaq9/How_do_I_find_out_my_hostname_do.htm[/url]
    ... The Sys::Hostname module (part of the standard perl
    distribution) will give you the hostname after which you can find
    out the IP address (assuming you have ...

    --
    Automated Google Searches from Casey West
    Questions or Problems? [email]casey@geeknest.com[/email]
    Casey West Guest

  4. #3

    Default Re: hostname

    Thomas Browner wrote:
    > Is there away to find all of the hostname on a lan with use of perl?
    Portable to most systems:

    use Sys::Hostname;
    my $host = hostname;

    or (on Windows systems):

    my $host = $ENV{COMPUTERNAME};

    or (on *nix systems):

    my $host = $ENV{HOSTNAME};

    --
    Helgi Briem Tćknideild Landssíminn EHF
    [email]hbriem@simnet.is[/email]
    Sími: 550-7466 GSM: 896-7466

    Helgi Briem Guest

  5. #4

    Default RE: hostname

    Thomas Browner wrote:
    > Is there away to find all of the hostname on a lan with use of perl?
    Getting a list of host names involves querying some kind of nameserver or
    directory service. What kind of LAN? What kind of hosts?

    You can query DNS to get the hosts in a domain using nslookup, dig, host, or
    similar. For example:

    host -l mydomain.com

    If you want to talk to the resolver directly from Perl, you can use the
    Net::DNS module.
    Bob Showalter Guest

  6. #5

    Default Finding Hosts On Lan - Re: hostname


    On Dec 4, 2003, at 8:18 AM, Bob Showalter wrote:
    > Thomas Browner wrote:
    >> Is there away to find all of the hostname on a lan with use of perl?
    [..]
    > You can query DNS to get the hosts in a domain using nslookup, dig,
    > host, or
    > similar. For example:
    >
    > host -l mydomain.com
    >
    > If you want to talk to the resolver directly from Perl, you can use the
    > Net::DNS module.
    first forgive the brief prefatory rant:

    <rant>
    Bad BOB! Not Nice Bob! No Cookie!
    </rant>

    since what Bob has done with that 'host -l mydomain.com'
    is oblige us to go back and REALLY work out what in
    the DNS is a 'host' and what is the bloat in the
    DNS that is not actually a Host, not in the sense
    that most folks would think of.

    At one end of the problem are all the 'jet direct'
    printer server devices that Hopped OUT at me, and
    while I love them, and they are cute, and they
    simplify the process of getting network printers
    up and available, do we REALLY want to include,
    or exclude them, from our notion of 'hostneff'.

    Then there is that stack of stuff that comes
    back as SRV entries, I mean do you really consider

    _ldap._tcp.mydomain.com

    to be a 'real host'? And Oh my GOD, there's
    the different 'terminal servers' that we use
    for headless severs to connect to, are they
    really 'hosts'?

    Then there are all of those DHCP entries, whether
    or not the license is active...

    At which point, of course, we could get bogged
    down in the usual problems of multi-homed hosts
    that have more than one NIC in them...

    So a part of the unpleasantry, is what exactly
    is 'finding hosts on a Lan' really a question about...

    ciao
    drieux

    ---

    Drieux Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139