Skip to content

Instantly share code, notes, and snippets.

View voondo's full-sized avatar

Romain Lalaut voondo

View GitHub Profile
@afair
afair / get_mxers.rb
Created April 24, 2012 14:38
Ruby: lookup email MX servers for a domain
require 'resolv'
class Domain
def mxers(domain)
mxs = Resolv::DNS.open do |dns|
ress = dns.getresources(domain, Resolv::DNS::Resource::IN::MX)
ress.map { |r| [r.exchange.to_s, IPSocket::getaddress(r.exchange.to_s), r.preference] }
end
return mxs
@chetan
chetan / yardoc_cheatsheet.md
Last active July 22, 2025 02:26
YARD cheatsheet