This is my best option, but in order to do that I'd need to retrieve the DNS configuration from the device: the address of the DNS server and the domain name. As far as I understand this information is not available to retrieve.

In general when writing (in my case porting) VoIP application while using such protocols as SIP, MSRP, STUN and TURN the correspondent standards require to perform NAPTR & SRV DNS queries.