문제

My C++ application has to lookup a DNS SRV record pointing to an IPv6 address. From what I researched so far, the res_search() family of functions is the way to go.

Does anyone have an example how to prepare such a query and how to extract the IPv6 result ?

도움이 되었습니까?

해결책

res_search() (or req_query) is probably the way to go to obtain the initial SRV record.

However the SRV record can only contain a hostname, not a literal IPv6 address.

You should feed the hostname contents of that record into the getaddrinfo() function which can then look up both IPv4 and IPv6 addresses at the same time.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top