Did you try those commands? They support what I said.

gethostbyname("unix.unb.ca") (an alias) returns jupiter.sun.csd.unb.ca for name, unix.unb.ca for alias and 131.202.3.8 for address.

gethostbyname("jupiter.sun.csd.unb.ca") returns jupiter.sun.csd.unb.ca for name, nothing for alias (even though it has unix.unb.ca for alias) and 131.202.3.8 for address.

gethostbyaddr(inet_aton("131.202.3.8"), AF_INET)) returns jupiter.sun.csd.unb.ca for name, nothing for alias (even though it has unix.unb.ca for alias) and 131.202.3.8 for address.

DNS simply does not provide the means to specify or query the information needed. You could parse the zone file if you had access to it, but the OP indicated he does not (at least, not via DNS).

There's also the scenario where domains from different zone files point to the same address:
cosplay.ca.  A 63.111.28.139
adaelis.com. A 63.111.28.139
Unless you had the zone files for every domain out in existance -- and no machine ever does or ever could -- you'd never be sure that you knew all the domains that point to an address. However, this paragraph is probably beyond the scope of the OP's question.


In reply to Re^3: DNS aliases by ikegami
in thread DNS aliases by UberGeek

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.