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 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