in reply to Re: Finding hostname aliases
in thread Finding hostname aliases

And then there are wildcard DNS records. Try the above code (assuming the script is called "resolve") with:
$ perl resolve www.startpagina.nl
which gives:
www.startpagina.nl is www.startpagina.nl addr #0 is [62.69.162.8] addr #1 is [62.69.162.6] addr #2 is [62.69.162.7]
All nice and good, you would say. You get 3 IP-numbers and it resolves back correctly. Now you want to find all the aliases to "www.startpagina.nl". Try this by doing:
$ perl resolve anythingyoucanthinkof.startpagina.nl
which generates this output:
anythingyoucanthinkof.startpagina.nl is anythingyoucanthinkof.startpag +ina.nl addr #0 is [62.69.162.7] addr #1 is [62.69.162.8] addr #2 is [62.69.162.6] That addr reverses to host www.startpagina.nl! www.startpagina.nl is www.startpagina.nl addr #0 is [62.69.162.8] addr #1 is [62.69.162.6] addr #2 is [62.69.162.7]
Now replace "anythingyoucanthinkof" with anything else you can think of. Then meditate on the number of aliases "www.startpagina.nl" has. ;-)

Hope this helps.

Liz

Replies are listed 'Best First'.
Re: Re: Re: Finding hostname aliases
by marknm (Acolyte) on Sep 12, 2003 at 14:04 UTC
    Thanks for all the pointers - now understand a lot more about how to properly use Net::hostent. However, my problem still remains. For instance, if I use the code snippet supplied my shenme, I get exactly the output promised. But my problem is that I would like to be able to give 'a562.cd.akamai.net' as the argument and have it return 'www.microsoft.com' as an alias. Alas, this does not happen and it appears that this is indeed the way this module (Net::hostent) is intended to work. So I am still wandering in the dark :( Thanks for all your efforts - Mark
      Hope this analogy will help you get out of the dark.

      "a562.cd.akamai.net" is a description of how to get to one or more IP-numbers (Rome).
      "www.microsoft.com" is another description to get to the same IP-number(s) (Still Rome).

      You're asking, given "Rome", to be able to tell all the possible ways to Rome. There could be one, there could be thousands. You won't be able to find out from "Rome". There is no way to know, unless you start trying them out one by one (in a Shakespeare monkey manner).

      Another analogy. You call yourself "marknm". But can you know what other people call you unless they tell you? No. Not unless your psychic. And even that could be considered them telling you what they call you.

      Hope this clears things up.

      Liz