Most OSs let the administrator configure how the process of "name resolution" (converting names to addresses) takes place. Some common options, and they can be used individually or searched in some configurable order, are: a local file (e.g. HOSTS or /etc/hosts), a NIS database, or DNS the Domain Name System. The later is a distributed database of name to address (and the reverse) mappings. You may have an internal DNS and the Internet has one for its names (e.g. www.perlmonks.org).

A domain administrator can put in hostname-address pairs for addresses that don't exist. vroom or the administrator for perlmonks could put in "nosuchhost.perlmonks.org" at some address. This might be for testing. A name could also resolve to an address of a host that was offline becuse it was failing or down for maintenance. DNS, hosts, and NIS only return the mappings. This is probably from the traditional UNIX philosophy that a tool should do one thing and do it well. If you want to see if a host exists, try to access it. ping might work if it is not blocked at a firewall, but it might not.

HTH, --traveler


In reply to Re: gethostbyname by traveler
in thread gethostbyname by hotshot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.