-
Notifications
You must be signed in to change notification settings - Fork 79
/
profile-godaddy
executable file
·98 lines (70 loc) · 2.57 KB
/
profile-godaddy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env ruby
# encoding: UTF-8
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/lib')
require 'pp'
require 'domain-profiler'
require 'rubygems'
require 'gchart'
require 'erb'
def fullname(name)
Name.new.full(name)
end
class Array
def lookup(host)
self.map{|name| Name.new.simplify(name,host) }.uniq
end
end
if ARGV.length != 2
print "Usage: ./profile-godaddy [file containing one domain per line] 'name of company grouping'\n"
exit
end
filename = ARGV[0]
file = File.new(filename)
hosts = {}
list_name = ARGV[1] ? ARGV[1] : 'REPLACE ME'
max_domain_length = 0
file.map {|host|
if match_data = host.match(/^#List:(.*)/)
list_name = match_data[1]
end
next if host.match(/^#/)
host.chomp!
profile = DomainProfiler.new(host)
if(host.length > max_domain_length)
max_domain_length = host.length
end
registrar = profile.whois.registrar.lookup(host)
dns_host = profile.dns.ns.map{|record| Name.new.shorten(record.answer) }.lookup(host)
ssl_issuer = profile.ssl.ca.lookup(host)
out = {}
out[:registrar] = (registrar[0] == :godaddy) ? 4 : 0
out[:dns_host] = (dns_host[0] == :godaddy) ? 2 : 0
out[:ssl_issuer] = (ssl_issuer[0] == :godaddy) ? 1 : 0
out[:sort_key] = out[:registrar] + out[:dns_host] + out[:ssl_issuer]
hosts[host] = out
}
print "This is a list of all %s companies that appear to do business with \nGoDaddy.\n" % [list_name]
puts <<PREAMBLE_END
In addition to showing which domains were registered through GoDaddy, this list
also shows domains that use GoDaddy's DNS service or use SSL certificates
purchased from GoDaddy.
Since it's easier to stop doing business with GoDaddy if your DNS is hosted
elsewhere, I've sorted this list according to the relative ease of moving away
from GoDaddy: The closer a domain is to the top of this list, the easier it
should be for the owners of that domain to stop doing business with GoDaddy.
---
Corrections to this list are welcome.
I prefer pull-requests on GitHub, you can also contact me on Twitter (@jf).
The code I used to generate this list is here:
https://github.com/jpf/domain-profiler
---
PREAMBLE_END
# Turn the list of host data into a hash of type data
hosts.sort_by{ |hostname,data| data[:sort_key].to_s + hostname }.each do |hostname,data|
next unless data[:sort_key] > 0
puts "%s %s %s %s" % [hostname.ljust(max_domain_length,' '),
(data[:registrar] > 0) ? 'REGISTRAR' : ' ',
(data[:dns_host] > 0) ? 'DNS' : ' ',
(data[:ssl_issuer] > 0) ? 'SSL' : ' '
]
end