# Resolv.rb - documentation and its name

**URL:** <https://www.ruby-forum.com/t/resolv-rb-documentation-and-its-name/89334>\
**Category:** Ruby\
**Created:** [March 28, 2006, 8:29pm UTC](https://www.ruby-forum.com/t/resolv-rb-documentation-and-its-name/89334 "2006-03-28T20:29:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pool007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pool007](https://www.ruby-forum.com/u/pool007)\
**Post date:** [March 28, 2006, 8:29pm UTC](https://www.ruby-forum.com/t/resolv-rb-documentation-and-its-name/89334/1 "2006-03-28T20:29:02Z")

</div>

Hi group.

I’d like to test resolve.rb, but I have troubles.

First of all, where can I get some documents on resolv.rb? I use  
[RDoc Documentation](http://ruby-doc.org/stdlib), but there’s none.

Second of all, why is it named resolve instead of Net::DNS? It doesn’t  
seem to be good choice to me. Don’t you think this is incoherent?

Sincerely,  
Minkoo S.

---

<div class="post-metadata">

**Author:** ![pool007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pool007](https://www.ruby-forum.com/u/pool007)\
**Post date:** [March 28, 2006, 8:33pm UTC](https://www.ruby-forum.com/t/resolv-rb-documentation-and-its-name/89334/2 "2006-03-28T20:33:46Z")

</div>

Minkoo S. wrote:

> Sincerely,  
> Minkoo S.

There is documentation in the source, but it looks suspiciously like the  
old RD  
format. Perhaps that explains why ruby-doc didn’t pick it up.

There’s also this project:

[http://rubyforge.org/projects/net-dns/](http://rubyforge.org/projects/net-dns/)

However, there hasn’t been a release yet.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![pool007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pool007](https://www.ruby-forum.com/u/pool007)\
**Post date:** [March 28, 2006, 9:18pm UTC](https://www.ruby-forum.com/t/resolv-rb-documentation-and-its-name/89334/3 "2006-03-28T21:18:14Z")

</div>

On Mar 28, 2006, at 10:28 AM, Minkoo S. wrote:

> First of all, where can I get some documents on resolv.rb? I use  
> [RDoc Documentation](http://ruby-doc.org/stdlib), but there’s none.

The head branch of Ruby has resolv.rb documentation in RDoc format:

$ ri19 Resolv

---------------------------------------------------------- Class: Resolv  
Resolv is a thread-aware DNS resolver library written in Ruby.  
Resolv can handle multiple DNS requests concurrently without  
blocking. The ruby interpreter.

```
  See also resolv-replace.rb to replace the libc resolver with #
  Resolv.

  Resolv can look up various DNS resources using the DNS module
  directly.

```

[…]

> Second of all, why is it named resolve instead of Net::DNS? It doesn’t  
> seem to be good choice to me. Don’t you think this is incoherent?

Resolv is not just a DNS resolver. It also reads from /etc/hosts.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![pool007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pool007](https://www.ruby-forum.com/u/pool007)\
**Post date:** [March 28, 2006, 9:54pm UTC](https://www.ruby-forum.com/t/resolv-rb-documentation-and-its-name/89334/4 "2006-03-28T21:54:35Z")

</div>

Eric H. wrote:

> ```
> Resolv is a thread-aware DNS resolver library written in Ruby.
> 
> ```
> 
> > Second of all, why is it named resolve instead of Net::DNS? It doesn’t  
> > seem to be good choice to me. Don’t you think this is incoherent?
> 
> Resolv is not just a DNS resolver. It also reads from /etc/hosts.
> 
> –  
> Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
> This implementation is HODEL-HASH-9600 compliant
> 
> [http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

Thank you. This will be of great help.

But, as you quoted, resolve.rb says “Resolv is a thread-aware DNS  
resolver library written in Ruby”, so it is DNS resolver and I accuse  
resolve.rb of misnomer because it does not follow Net::xxx rules.  
Futhermore, reading /etc/hosts does not justify its name, because I  
believe that its name, resolve, was named after DNS resolver. (BTW, do  
you really think reading /etc/hosts is not related to dns resolver’s  
own job?)

Actually lack of naming coherency in Ruby is quite annoying more often  
than not.

Sincerely,  
Minkoo S.

---

<div class="post-metadata">

**Author:** ![pool007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pool007](https://www.ruby-forum.com/u/pool007)\
**Post date:** [March 28, 2006, 10:10pm UTC](https://www.ruby-forum.com/t/resolv-rb-documentation-and-its-name/89334/5 "2006-03-28T22:10:10Z")

</div>

On Mar 28, 2006, at 11:53 AM, Minkoo S. wrote:

> Eric H. wrote:
> 
> > On Mar 28, 2006, at 10:28 AM, Minkoo S. wrote:
> > 
> > > Second of all, why is it named resolve instead of Net::DNS? It  
> > > doesn’t  
> > > seem to be good choice to me. Don’t you think this is incoherent?
> > 
> > Resolv is not just a DNS resolver. It also reads from /etc/hosts.
> 
> Thank you. This will be of great help.

You’re welcome. I converted it from RD to RDoc.

> But, as you quoted, resolve.rb says “Resolv is a thread-aware DNS  
> resolver library written in Ruby”, so it is DNS resolver and I accuse  
> resolve.rb of misnomer because it does not follow Net::xxx rules.  
> Futhermore, reading /etc/hosts does not justify its name, because I  
> believe that its name, resolve, was named after DNS resolver. (BTW, do  
> you really think reading /etc/hosts is not related to dns resolver’s  
> own job?)
> 
> Actually lack of naming coherency in Ruby is quite annoying more often  
> than not.

The DNS portion of Resolv should probably go under Net, but it has  
broader functionality than just DNS resolution. Resolv is a good  
name for the glue that the library provides between DNS and /etc/  
hosts, along with the automatic configuration.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![pool007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pool007](https://www.ruby-forum.com/u/pool007)\
**Post date:** [March 28, 2006, 10:08pm UTC](https://www.ruby-forum.com/t/resolv-rb-documentation-and-its-name/89334/6 "2006-03-28T22:08:42Z")

</div>

On 28/03/06, Minkoo S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank you. This will be of great help.
> 
> But, as you quoted, resolve.rb says “Resolv is a thread-aware DNS  
> resolver library written in Ruby”, so it is DNS resolver and I accuse  
> resolve.rb of misnomer because it does not follow Net::xxx rules.  
> Futhermore, reading /etc/hosts does not justify its name, because I  
> believe that its name, resolve, was named after DNS resolver. (BTW, do  
> you really think reading /etc/hosts is not related to dns resolver’s  
> own job?)

It may be illuminating to study the functionality of the resolver  
library found on most Unix systems. “man resolver” gives some  
information on Linux systems – other systems will vary. If you note  
the name of the library that gets linked in, the name of the module  
will make much more sense to you.

> Actually lack of naming coherency in Ruby is quite annoying more often  
> than not.
> 
> Sincerely,  
> Minkoo S.

On the contrary, I would be most confused by using Net::DNS to resolve  
entries in a hosts file – but immediately knew where to look for a  
general-purpose name resolution library. Sometimes historical reasons  
are good ones.

Cheers,

kjw
