From: pavel.mikhailyuk@... Date: 2017-03-29T09:17:33+00:00 Subject: [ruby-core:80464] [Ruby trunk Feature#13385] [PATCH] Make Resolv::DNS::Name validation similar to host and dig commands Issue #13385 has been reported by pavel.mikhailyuk@gmail.com (Pavel Mikhailyuk). ---------------------------------------- Feature #13385: [PATCH] Make Resolv::DNS::Name validation similar to host and dig commands https://bugs.ruby-lang.org/issues/13385 * Author: pavel.mikhailyuk@gmail.com (Pavel Mikhailyuk) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- # Abstract Add validations similar to **host** and **dig** commands to `Resolv::DNS::Name.create` # Background `Resolv::DNS::Name.create(str)` does not make any domain name validation. So it returns false positive results for queries like ~~~ ruby [1] pry(main)> Resolv::DNS.new.getresources('.gmail....com', Resolv::DNS::Resource::IN::MX) => [#, @preference=10, @ttl=3600>, #, @preference=20, @ttl=3600>, #, @preference=5, @ttl=3600>, #, @preference=40, @ttl=3600>, #, @preference=30, @ttl=3600>] ~~~ while ~~~ text ~ dig .gmail....com MX dig: '.gmail....com' is not a legal name (empty label) ~~~ I added basic RFC validations in `Resolv::DNS::Label.split` to get `ArgumentError` with messages similar to **host** and **dig** commands. # Pull request [https://github.com/ruby/ruby/pull/1551](https://github.com/ruby/ruby/pull/1551) -- https://bugs.ruby-lang.org/ Unsubscribe: