private static Map<String, SrvRecord> decode(String encodedValue) {
        Map<String, SrvRecord> answer = new HashMap<>();
        StringTokenizer st = new StringTokenizer(encodedValue, "{},:");
        while (st.hasMoreElements()) {
            String key = st.nextToken();
            String host = st.nextToken();
            // Host entries in DNS should end with a ".".
            if (host.endsWith(".")) {
                host = host.substring(0, host.length()-1);
            }
            int port = Integer.parseInt(st.nextToken());
            answer.put(key, new SrvRecord(host, port, false));
        }
        return answer;
    }
Sets the internal DNS that allows to specify target IP addresses and ports
to use for domains. The internal DNS will be checked up before performing an
actual DNS SRV lookup.

@param dnsOverride the internal DNS that allows to specify target IP addresses and ports
       to use for domains.
xmppserver/src/main/java/org/jivesoftware/openfire/net/DNSUtil.java