You'll find the light with :
perldoc Net::DNS
or
perldoc perlfunc (see gethostbyaddr)
or
SuperSearch (which gave me this node)
And I'd be glad to help on a more specific question ;-)
"Only Bad Coders Badly Code In Perl" (OBC2IP)
| [reply] |
Look at Net::DNS. I have also used Email::Valid, which will use either Net::DNS (if installed) or do the nslookup (if Net::DNS isn't installed). The code in both modules maybe an interesting read to you.
Also, 'perldoc -f gethostbyaddr' is good reading.
Cheers,
KM | [reply] |
to the two monks who answered my question:
thanks a lot. I'm sure I'll have more questions later, but since the perl community is so cool, I won't be afraid to ask. I'm already trying to convince my co-workers to convert after I converted from C to perl-sites like this are one of the main reasons. So thanks again for the help--it means more than you might think! | [reply] |
Your question makes me wonder if I'm missing something.
Specifying a nameserver instead of using
things like gethostbyname and letting the OS do the lookups
for you on whatever servers it's configured to use can lead
to problems. For example, if
your nameservers change, you now have one additional place
you need to remember to change that information, and if
you move this script to a different machine, you'll likely
need to update it again.
This is not to say there are no valid reasons for doing so,
but none are coming readily to my mind.
hdp. | [reply] |
Maybe this will answer that last one:
I came up with this idea yesterday because the name server here went down, as it does many times. It was frustrating to me because I knew that if I had the IPs of the sites, I would at least be able to do some surfing (work is boring, and also a bitch because our air conditioning wasn't ready yet--yesterday was 80 something here). So I thought that a great way to apply what I've learned so far would be to write a little script to fetch the IPs from an alternate nameserver. Is this kind of a weird reason? Probably. But this was more of an excercise than anything.
| [reply] |