@Nonnull
    static String constructLookup(@Nonnull final String service, @Nonnull final String proto, @Nonnull final String name)
    {
        String lookup = "";
        if ( !service.startsWith( "_" ) )
        {
            lookup += "_";
        }
        lookup += service;

        if ( !lookup.endsWith( "." ) )
        {
            lookup += ".";
        }

        if ( !proto.startsWith( "_" ) )
        {
            lookup += "_";
        }
        lookup += proto;

        if ( !lookup.endsWith( "." ) )
        {
            lookup += ".";
        }

        lookup += name;
        if ( !lookup.endsWith( "." ) ) {
            lookup += ".";
        }

        return lookup.toLowerCase();
    }
Constructs a DNS SRV lookup query (eg: <tt>_service._proto.name.</tt>)

@param service the symbolic name of the desired service.
@param proto the transport protocol of the desired service; this is usually either TCP or UDP.
@param name the domain name for which this record is valid.
@return A DNS lookup query
xmppserver/src/main/java/org/jivesoftware/openfire/net/DNSUtil.java