Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/ruby -w
- require 'socket'
- require 'uri'
- require 'net/http'
- class Domain
- def read_file(dns_file,url)
- pra = URI(url)
- counter = 1
- file = File.new(dns_file, "r")
- while (line = file.gets)
- full_url = (line+"."+pra.host)
- puts(full_url)
- counter = counter + 1
- end
- file.close
- end
- end
- dns = Domain.new
- dns.read_file("test.txt","http://example.com")
- -----------
- result
- test
- .example.com
- mail
- .example.com
- cpanel
- .example.com
- file
- .example.com
- gallery
- .example.com
- one
- .example.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement