Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Perform an MX query with Ruby
# requires net-dns gem
require 'net/dns'
res = Net::DNS::Resolver.new
mx = res.mx("google.com")
mx.first.exchange
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment