Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们的系统上有多个本地 IP。我们需要使用众多本地 IP 之一执行 DNS 查询(MX、NX 查找)。
我怎样才能做到这一点?例如,我找到了函数res_initand res_send,但他们不能这样做。有什么建议么?
res_init
res_send
据我了解,我需要使用该bind函数将套接字附加到本地 IP 之一。我必须使用getaddrinfoDNS 查找吗?
bind
getaddrinfo
要进行 DNS 查找,请使用getaddrinfo.
这是手册页,这是我使用的很棒的 UNIX/Linux/Winsock 编程指南。很棒的部分getaddrinfo,以及其他所有内容。