I found some more DNS issues:
String naptrRecords = NetworkUtils.getNAPTRRecords(address);
-> These naptrRecords are not necessarily SRV records, but might be an A, U or a chained NAPTR
- Returns only IP addresses, not hostnames (because the InetAddress of getARecord doesn't contain the hostname)
- The retuned IP addresses are IPv4 only, although the target of the SRV might be IPv6 as well
-> Because of the missing hostname in the records returned from NetworkUtils.getSRVRecords there are again PTR queries. The resolveAddresses later on actually performs an A/AAAA on the PTR of the IP of the SRV-Host.
-> This comment is therefore invalid
//as these are already resolved addresses (the SRV res.)
// lets get it without triggering a PTR
1) Return a sorted array of [hostname, port]
2) Query for IPv4 and IPv6 inside getSRVRecord and make getA[AAA]Record return InetAdresses with the hostname prefilled
Solution 2 makes further lookups of IP addresses after an SRV query superfluous
Example: Step through the lookup of sip2sip.info
@Emil: I need the correct hostname of the current proxy returned from NAPTR/SRV queries for the other off-list issue I'm working on.