This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3200 sl_NetAppDnsGetHostByName返回错误

我在连接服务器的时候,先调用sl_NetAppDnsGetHostByName来获取服务器的ip地址,偶尔会出现sl_NetAppDnsGetHostByName返回失败的情况,error code为-159,错误码的定义为

#define SL_NET_APP_DNS_QUERY_NO_RESPONSE              (-159)  /* DNS query failed, no response                        */
当出现这种情况后,反复调用sl_NetAppDnsGetHostByName,返回的错误码都是-159,

紧接着我反复重新上电3200,同样会出现这个问题。过了3~5分钟后,我继续重启3200,此时sl_NetAppDnsGetHostByName返回成功。

我想请问下sl_NetAppDnsGetHostByName返回-159的原因是什么?出现此种情况,该怎么恢复?

谢谢。

  • 根据描述,怀疑是因为无法连接到DNS服务器,出现该错误时,建议给点时间,等待路由重新连接再调用sl_NetAppDnsGetHostByName
  • 3200的DNS服务器可以指定吗?默认用的是什么DNS服务器?
  • The mDNS and DNS-SD feature provides the ability to find and advertise services on its local network, and resolve host names to IP addresses without using a local name server. By supporting RFCs 6762 and 6763, the mDNS module advertises services, sends query responses to
    peer queries, and listens to peer advertisements.
    mDNS uses the same programming interfaces, packet formats, and operating semantics as the unicast Domain Name System (DNS), except that mDNS uses IP multicast User Datagram Protocol (UDP) packets. By default, mDNS exclusively resolves host names ending with the .local top-level domain (TLD).

    The mDNS Ethernet frame is a multicast UDP packet to:
    • MAC address 01:00:5E:00:00:FB
    • IPv4 address 224.0.0.251 or IPv6 address FF02::FB
    • UDP port 5353
  • 你的意思是你的这个mdns所对应的dns服务器的地址是固定的,无法更改?那dns被污染了咋办