title: "gem install rails" fails with DNS error
body: <pre><code>$ rvm use
  Using /home/owner/.rvm/gems/ruby-2.1.2
  $ gem install rails
  ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
      Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.network" port 80 (http://your-dns-needs-immediate-attention.network/quick/Marshal.4.8/thread_safe-0.3.4.gemspec.rz)
  $ gem update --system
  ...
  $ gem -v
  2.4.1
  $ gem install rails
  ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
      Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.network" port 80 (http://your-dns-needs-immediate-attention.network/quick/Marshal.4.8/rails-4.1.5.gemspec.rz)
  </code></pre>
  
  <p>I have attempted:</p>
  
  <ol>
  <li>Installing other gems (devise, activerecord). I get the same error.</li>
  <li>Reinstalling RVM</li>
  <li>Running <code>gem update --system</code></li>
  <li>Setting static DNS to google's 8.8.8.8 and 8.8.4.4</li>
  <li>Adding <code>https://production.cf.rubygems.org</code> as a gem source (see below for error)</li>
  <li>Installing 14.04 over my previous 12.04. Error persists. The source of the error must be outside my computer.</li>
  </ol>
  
  <h2>Additional information about my connection:</h2>
  
  <ol>
  <li>I can connect to <code>https://rubygems.org/</code> through my browser</li>
  <li>My modem's firewall is completely disabled.</li>
  <li><code>$ curl -v --head https://rubygems.org</code> output:  <a href="http://pastebin.com/ca6DAvaU" rel="nofollow noreferrer">http://pastebin.com/ca6DAvaU</a></li>
  </ol>
  
  <h2>My /etc/resolv.conf</h2>
  
  <pre><code>$ cat /etc/resolv.co
  # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
  #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
  nameserver 8.8.8.8
  nameserver 8.8.4.4
  nameserver 75.75.75.75
  search home.network
  </code></pre>
  
  <h2>Add direct gem source</h2>
  
  <p>Ref: <a href="https://stackoverflow.com/a/19299266/3993020">https://stackoverflow.com/a/19299266/3993020</a></p>
  
  <pre><code>owner@owner-Z87X-UD3H:~$ gem sources --add https://production.cf.rubygems.org
  Error fetching https://production.cf.rubygems.org:
      Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.network" port 443 (https://your-dns-needs-immediate-attention.network/specs.4.8.gz)
  </code></pre>
  
  <h2>Additional debug information for <code>gem install rails</code></h2>
  
  <pre><code>owner@owner-Z87X-UD3H:~$ gem install rails --debug -V
  NOTE:  Debugging mode prints all exceptions even when rescued
  Exception `LoadError' at /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/resolv.rb:169 - LoadError
  HEAD https://api.rubygems.org/api/v1/dependencies
  Exception `OpenSSL::SSL::SSLErrorWaitReadable' at /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/openssl/buffering.rb:182 - read would block
  200 OK
  GET https://api.rubygems.org/api/v1/dependencies?gems=rails
  Exception `OpenSSL::SSL::SSLErrorWaitReadable' at /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/openssl/buffering.rb:182 - read would block
  Exception `OpenSSL::SSL::SSLErrorWaitReadable' at /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/openssl/buffering.rb:182 - read would block
  Exception `OpenSSL::SSL::SSLErrorWaitReadable' at /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/openssl/buffering.rb:182 - read would block
  Exception `OpenSSL::SSL::SSLErrorWaitReadable' at /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/openssl/buffering.rb:182 - read would block
  Exception `OpenSSL::SSL::SSLErrorWaitReadable' at /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/openssl/buffering.rb:182 - read would block
  200 OK
  Exception `Resolv::DNS::Config::NXDomain' at /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/resolv.rb:547 - _rubygems._tcp.api.rubygems.org
  Exception `Errno::ECONNREFUSED' at /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:879 - Connection refused - connect(2) for "your-dns-needs-immediate-attention.network" port 443
  Exception `Gem::RemoteFetcher::FetchError' at /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/remote_fetcher.rb:286 - Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.network" port 443 (https://your-dns-needs-immediate-attention.network/quick/Marshal.4.8/rails-4.1.5.gemspec.rz)
  ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
      Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.network" port 443 (https://your-dns-needs-immediate-attention.network/quick/Marshal.4.8/rails-4.1.5.gemspec.rz)
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/remote_fetcher.rb:286:in `rescue in fetch_path'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/remote_fetcher.rb:259:in `fetch_path'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/source.rb:146:in `fetch_spec'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/resolver/api_specification.rb:76:in `spec'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/resolver/installer_set.rb:77:in `add_always_install'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/dependency_installer.rb:461:in `resolve_dependencies'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/commands/install_command.rb:238:in `install_gem'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/commands/install_command.rb:299:in `block in install_gems'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/commands/install_command.rb:295:in `each'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/commands/install_command.rb:295:in `install_gems'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/commands/install_command.rb:202:in `execute'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/command.rb:307:in `invoke_with_build_args'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/command_manager.rb:168:in `process_args'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/command_manager.rb:138:in `run'
      /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/gem_runner.rb:54:in `run'
      /home/owner/.rvm/rubies/ruby-2.1.2/bin/gem:21:in `&lt;main&gt;'
  </code></pre>