Benny Prijono schrieb: > Klaus Darilion wrote: >> Hi! >> >> According to documentation I have to manually specify the nameservers if >> I want to use SRV lookups. As I do not want users to configure them >> manually, do you have some ideas how I can retrieve the name servers >> from the OS? > > We can use GetNetworkParams() on Windows. Not sure how to do it on > Linux/Posix other than to parse /etc/resolv.conf, and that's the > reason why we don't have a portable getdnsservers() function in > pjlib since I'm not happy with having to do this. If anybody knows > an easier way, I'll be happy to add. I think there is no easier way. I've checked ares resolver (part of resiprocate) and they are doing it the same way: - GetNetworkParams on Windows - parsing /etc/resolv.conf on Unix Ares further suports MacOS. IMO it would be real cool if pjlib supports getting nameserver config too. PS: I have attached how I have done it in Windows. regards klaus -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: win32-getnameservers.c Url: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080115/fae05320/attachment.c