bluemonk/net-dns — Issue #29: Using command line input as question gives Net::DNS::Question::NameError
Author: eik3
Created: 2012-01-27 12:30:19+00:00
State: open

```
$ ruby -rrubygems -rnet/dns/resolver -e 'puts Net::DNS::Resolver.start(ARGV[0])' example.com
/home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/resolver.rb:1223: Use RbConfig instead of obsolete and deprecated Config.
/home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/question.rb:202:in `rescue in check_name': Question name "example.com" not valid (Net::DNS::Question::NameError)
from /home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/question.rb:195:in `check_name'
from /home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/question.rb:94:in `initialize'
from /home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/packet.rb:140:in `new'
from /home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/packet.rb:140:in `initialize'
from /home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/resolver.rb:1125:in `new'
from /home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/resolver.rb:1125:in `make_query_packet'
from /home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/resolver.rb:948:in `send'
from /home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/resolver.rb:906:in `query'
from /home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/resolver.rb:851:in `search'
from /home/eh/.rvm/gems/ruby-1.9.3-p0/gems/net-dns-0.6.1/lib/net/dns/resolver.rb:1046:in `start'
from -e:1:in `

'
```

My workaround is `Net::DNS::Resolver.start(String.new(ARGV[0]))` but should that be necessary?