localresolv 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Gemfile +2 -0
  2. data/Gemfile.lock +22 -0
  3. data/bin/localresolv +20 -0
  4. data/localresolv.gemspec +16 -0
  5. metadata +65 -0
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
@@ -0,0 +1,22 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ localresolv (1.0.0)
5
+ rubydns
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ eventmachine (1.0.3)
11
+ rainbow (1.1.4)
12
+ rexec (1.5.1)
13
+ rainbow
14
+ rubydns (0.6.3)
15
+ eventmachine (~> 1.0.0)
16
+ rexec (~> 1.5.1)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ localresolv!
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubydns'
3
+
4
+ PORT = 27891
5
+ LISTEN = '0.0.0.0'
6
+
7
+ if ARGV.empty?
8
+ puts "usage: localresolv [domains]"
9
+ exit 1
10
+ else
11
+ puts "\e[32mListening on: #{ARGV.join(', ')}\e[0m"
12
+ end
13
+
14
+ RubyDNS::run_server(:listen => [[:udp, LISTEN, PORT], [:tcp, LISTEN, PORT]]) do
15
+ ARGV.each do |domain|
16
+ match(/#{domain}\z/, Resolv::DNS::Resource::IN::A) do |transaction|
17
+ transaction.respond!("127.0.0.1")
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,16 @@
1
+ $LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'localresolv'
5
+ s.version = '1.0.0'
6
+ s.platform = Gem::Platform::RUBY
7
+ s.summary = s.description = "A DNS server which returns 127.0.0.1 for any domain you provide"
8
+ s.files = Dir["**/*"]
9
+ s.add_dependency('rubydns')
10
+ s.bindir = "bin"
11
+ s.executables << 'localresolv'
12
+ s.has_rdoc = false
13
+ s.author = "Adam Cooke"
14
+ s.email = "adam@atechmedia.com"
15
+ s.homepage = "http://atechmedia.com"
16
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: localresolv
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Adam Cooke
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-07-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rubydns
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: A DNS server which returns 127.0.0.1 for any domain you provide
31
+ email: adam@atechmedia.com
32
+ executables:
33
+ - localresolv
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - bin/localresolv
38
+ - Gemfile
39
+ - Gemfile.lock
40
+ - localresolv.gemspec
41
+ homepage: http://atechmedia.com
42
+ licenses: []
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ requirements: []
60
+ rubyforge_project:
61
+ rubygems_version: 1.8.23
62
+ signing_key:
63
+ specification_version: 3
64
+ summary: A DNS server which returns 127.0.0.1 for any domain you provide
65
+ test_files: []