Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: MX Lookups

by grinder (Bishop)
on Jun 10, 2002 at 20:31 UTC ( #173291=note: print w/ replies, xml ) Need Help??


in reply to MX Lookups

If you have Net::DNS lying around this is a snap to write:

#! /usr/local/bin/perl -w use strict; use Net::DNS; my $dns = new Net::DNS::Resolver; for my $domain( @ARGV ) { my $mx = $dns->query( $domain, 'MX' ); print "$domain\n"; foreach my $rr ($mx->answer) { print "\t", $rr->exchange, ' (', $rr->preference, ")\n"; } } __END__ output: % ./mx perl.org perlmonk.org perlmonks.org perl.com perl.org lux.valueclick.com (20) perlmail.valueclick.com (10) perlmonk.org perlmonk.org (10) perlmonks.org mail.egl.net (5) perl.com mail.perl.com (0)


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'


Comment on Re: MX Lookups
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://173291]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2014-08-23 15:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (174 votes), past polls