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.

sl_NetAppDnsGetHostByName() error

Other Parts Discussed in Thread: CC3200

Hi

 

What does it mean when sl_NetAppDnsGetHostByName() returns error code SL_NET_APP_DNS_INTERNAL_8 (-172)?

The Simple Link Driver documentation does not cover this error code for sl_NetAppDnsGetHostByName().

 

What is the character limit for a domain name passed to sl_NetAppDnsGetHostByName()?

 

Best

Steve Smith

  • Hi Steven,


    We will look into this and get back to you.


    Regards,
    Aashish
  • Hi Steven,

    Do you set static or dynamic IP configuration? Also tell us what ip your device acquired by SL_NETAPP_IPV4_IPACQUIRED_EVENT event .

    Regards,

    Aashish

  • Hi Steven,


    Please share sniffer log also.


    Regards,
    Aashish
  • Hi Aashish

    Dynamic IP configuration.
    IP acquired is 192:168:1:108
    Don't have a sniffer log yet for you.

    I don't get the SL_NET_APP_DNS_INTERNAL_8 error when a valid domain name is passed to sl_NetAppDnsGetHostByName(). I only get the error when and invalid domain name is passesd, for instance domain name "abcdefghijklmnopqr.com" reliably causes sl_NetAppDnsGetHostByName() to return SL_NET_APP_DNS_INTERNAL_8. I need to find out if this is expected under these circumstances and if I can recover elegantly from this error.

    Best
    Steve
  • Hi Aashish

    I emailed to you our sniffer log last week. Did you receive it? Is there any further progress on this query?

    Best,
    Steve
  • Hi Steve,


    SL_NET_APP_DNS_INTERNAL_8 means it is a response from server on failure to process the query. As per your capture log server sending 0011 (Reply code: No such name (3)) as DNS flag. We will add this error code in future release.


    Regards,
    Aashish
  • OK thanks Aashish

    Steve
  • Hi All,

    Got the same error.

    I sucesfully connected to a AP, got IP, can ping 'ti.com'. But when try to resolve IP by hostname:

    #define SERVER_NAME            "testhost.local"
    
    iretvalmDNS = sl_NetAppDnsGetHostByName( SERVER_NAME,strlen(SERVER_NAME),&pAddr,SL_AF_INET);
    
    if(iretvalmDNS == 0)
    {
    	UART_PRINT("DONE\n\r");
    	Report("Addr: %d.%d.%d.%d\n\r",SL_IPV4_BYTE(pAddr,3),
    			SL_IPV4_BYTE(pAddr, 2), SL_IPV4_BYTE(pAddr, 1),
    			SL_IPV4_BYTE(pAddr, 0));
    }else{
      switch (iretvalmDNS){
      case SL_NET_APP_DNS_QUERY_NO_RESPONSE:UART_PRINT("SL_NET_APP_DNS_QUERY_NO_RESPONSE\n\r");break;
      case SL_NET_APP_DNS_NO_SERVER:UART_PRINT("SL_NET_APP_DNS_NO_SERVER\n\r");break;
      case SL_NET_APP_DNS_QUERY_FAILED:UART_PRINT("SL_NET_APP_DNS_QUERY_FAILED\n\r");break;
      case SL_NET_APP_DNS_MALFORMED_PACKET:UART_PRINT("SL_NET_APP_DNS_MALFORMED_PACKET\n\r");break;
      case SL_NET_APP_DNS_MISMATCHED_RESPONSE  :UART_PRINT("SL_NET_APP_DNS_MISMATCHED_RESPONSE\n\r");break;
      default: UART_PRINT("Err: unknown (%d)\n\r", iretvalmDNS);break;
      };
    }

    Here is my log (I use UART_PRINT)

    Host Driver Version: 1.0.1.6
    Build Version 2.6.0.5.31.1.4.0.1.1.0.3.34
    MAC: BF:8C:01:5E:B8:F4
    [WLAN EVENT] STA Connected to the AP: kxY0TIMQ ,BSSID: 34:08:04:C2:71:4A
    Initialze MQTT client lib... Version: Client LIB 1.0.4, Common LIB 1.1.1.
    DONE
    [NETAPP EVENT] IP Acquired: IP=10.10.0.103 , Gateway=10.10.0.1
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....
    Err: unknown (-172)
    Resolve IP addres....

    I use Ubuntu machine with avahi and 'testhost' is hostname. I also can ping 'testhost.local' from another machine in my network.

    Have somebody  resolved the problem?

    update: when I switch off my mDNS host in my network I get exact the same error, so the error is not a sign of incorrect host name in resolution.

    update 2: well, I've changed SERVER_NAME to "google.com" and it resolved IP, so seems sl_NetAppDnsGetHostByName makes request to my router's DNS instead of make broadcast request which reach my local network mDNS host. As result I still can't resolve IP when SERVER_NAME = testhost.local. Any suggestions apreciated!

    Thanks!

  • Hi,

    I expect that mDNS request are not supported by sl_NetAppDnsGetHostByName() API. What I want to say? By this API you will not be able resolve .local address. But I am not 100%. This need to be confirmed by TI employee from R&D.

    Jan
  • Hi Jan,

    Thanks for clarification, and yes it would be great to confirm it from TI.

    I'm debugging now with Wireshark and attached request from my CC3200 do somebody can clarify is there method to resolve local addres or is there any alternative to make it possible resolve somehow host name addresses by name? Maybe install on host machine not avahi?

    Thanks for any clarification

    mnc.lanc.zip

  • well, I'm deeply dig into wireshark logs and seems mDNS is not supported at all.

    In code I use

    #define SERVER_NAME "mnc.local"
    iretvalmDNS = sl_NetAppDnsGetHostByName( SERVER_NAME,strlen(SERVER_NAME),&pAddr,SL_AF_INET);

    as in real request is ANY, and more over simple link response byitself on its own request, what is going on why simpleling does not request SERVER_NAME in real ethernaet packet? I'm requesting TI how can I tune simplelink to request my avahi mDNS?