[Ovirt-devel] [PATCH server] Use DNS SRV records for qpidd on appliance

Ian Main imain at redhat.com
Wed Feb 11 18:36:35 UTC 2009


On Wed, 11 Feb 2009 11:37:49 +0100
Alan Pevec <apevec at gmail.com> wrote:

> > +  Resolv::DNS.open do |dns|
> > +    begin
> > +      hostname = Socket.gethostbyname(Socket.gethostname).first
> > +      lst = hostname.split('.')
> > +      lst.shift
> > +      domainname = lst.join('.')
> 
> there really isn't  something like getdomainname in ruby lib?

I searched for a while and gave up.  If there is I'll gladly use
it.. actually I just grepped the ruby src and ruby-libs and can't find
anything around 'domain' anyway.

> > +      res = dns.getresource("_#{service}._#{proto}.#{domainname}", Resolv::DNS::Resource::IN::SRV)
> > +      server = res.target.to_s
> > +      port = res.port
> 
> This assumes that hostname is correctly set - I had reports where this
> wasn't the case, hence the following patch for the node:
> http://git.et.redhat.com/?p=ovirt-node.git;a=commitdiff;h=378b5f90b01e471cdf19d51fa7e81fa3139f9b80
> where all search domains, as defined in resolve.conf, are tried.
> Is there equivalent for dig +search option in  Resolve::DNS ?

Yes I'm seeing that already too :).  I'll try out your suggestion in your other emial.  Thanks Alan :)

    Ian




More information about the ovirt-devel mailing list