[Sussex] Ruby DNS library MX resolution problem

Thomas Adam thomas at edulinux.homeunix.org
Mon Jun 20 13:23:33 UTC 2005


On Mon, Jun 20, 2005 at 02:04:13PM +0100, Ronan Chilvers wrote:

> None of addresses[] resolve on my system. FYI, this is ruby 1.8.2 on
> Ubuntu. And dig can resolve the MXs for all these domains from the
> command line just fine, so my DNS resolution doesn't _seem_ to be the
> problem (cautious note in voice).
>
> Any ideas?

You must use String#chomp, hence:

a=[]
while l = STDIN.gets
  a << l.chomp()
end

a.each {|b|
  d=Checker.new(b)
}

Results in:

[n6tadam at station tmp]$ cat ./emails | ./Checker.rb 
Checking hotmail.com
mx3.hotmail.com
mx4.hotmail.com
mx1.hotmail.com
mx2.hotmail.com
Checking yahoo.co.uk
mx2.mail.ukl.yahoo.com
mx1.mail.ukl.yahoo.com
Checking amazon.co.uk
smtp-0101.amazon.com
smtp-2102.amazon.com
smtp-2101.amazon.com
smtp-0102.amazon.com
[n6tadam at station tmp]$ 

-- Thomas Adam

--  
"One of us is a cigar stand, and one of us is a lovely blue incandescent
guillotine" -- Stephen Malkmus, "Type Slowly" from "Brighten The Corners"




More information about the Sussex mailing list