Skip to content

Instantly share code, notes, and snippets.

@t0d0r
Created July 22, 2013 06:52
Show Gist options
  • Save t0d0r/6051774 to your computer and use it in GitHub Desktop.
Save t0d0r/6051774 to your computer and use it in GitHub Desktop.
hosts2ip.rb
#!/usr/bin/env ruby
# encoding: utf-8
# simple script to extract IP addresses for specific sites
# http://www.dkh.minfin.bg/bg/pubs/4/546
require 'socket'
hosts = <<__EOF__
www.bet365.com
www.bet365.net
www.goldbet.com
www.goldbetsports.com
www.betin.com
www.sportingbet.com
www.morganbet.eu
www.betuniq.eu
www.planetwin365.com
www.unibet.com
www.bet-at-home.com
www.doxxbet.com
www.efbet.com
globetcasino12.com
www.ladbrokes.com
www.betfair.com
www.offsidebet.com
www.tempobet.com
www.888.com
www.betfred.com
www.jetbull.com
www.bet7days.com
__EOF__
require 'pp'
hosts.split("\n").each { |h|
res = Socket.getaddrinfo(h, "http", nil, :STREAM)
puts "# #{h}"
res.each { |ip|
puts ip[2]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment