Advertisement
Guest User

Untitled

a guest
Mar 1st, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/usr/bin/ruby -w
  2. require 'socket'
  3. require 'uri'
  4. require 'net/http'
  5. class Domain
  6. def read_file(dns_file,url)
  7. pra = URI(url)
  8. counter = 1
  9. file = File.new(dns_file, "r")
  10. while (line = file.gets)
  11. full_url = (line+"."+pra.host)
  12. puts(full_url)
  13. counter = counter + 1
  14. end
  15. file.close
  16. end
  17. end
  18.  
  19. dns = Domain.new
  20. dns.read_file("test.txt","http://example.com")
  21.  
  22. -----------
  23. result
  24. test
  25. .example.com
  26. mail
  27. .example.com
  28. cpanel
  29. .example.com
  30. file
  31. .example.com
  32. gallery
  33. .example.com
  34. one
  35. .example.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement