Working with SRV records

On my current project at work I've been tasked with integrating LDAP into
our user permissions system. A requirement is to determine the LDAP
hostname using SRV records with a configured hostname as a fallback.

Anybody have experience or can point me to an example of retrieving a SRV
record and the hostname for it?

···

--
Darryl L. Pierce <mcpierce@gmail.com>
http://mcpierce.multiply.com/
"Bury me next to my wife. Nothing too fancy, though..." - Ulysses S. Grant
** Posted from http://www.teranews.com **

Darryl L. Pierce wrote:

On my current project at work I've been tasked with integrating LDAP into
our user permissions system. A requirement is to determine the LDAP
hostname using SRV records with a configured hostname as a fallback.

Anybody have experience or can point me to an example of retrieving a SRV
record and the hostname for it?

I did finally get the answer to this question:

resolver = Resolv::DNS.new
resolver.getresources("_ldap._tcp.`dnsdomainname`,Resolv::DNS::Resource::IN:ANY).collect
do |resource|
# process the resource
end

···

--
Darryl L. Pierce <mcpierce@gmail.com>
http://mcpierce.multiply.com/
"Bury me next to my wife. Nothing too fancy, though..." - Ulysses S. Grant
** Posted from http://www.teranews.com **