Microchip
直播中

李丽

7年用户 304经验值
私信 关注
[问答]

为什么我的DNS解析为0.0.0.0?

为什么我的DNS解析为0.0.0.0?它被称为SuxChar*URL=“www. GooGl.com”;IPNS4ADDR ADDR;DNSRES= TCPIPSY-DNSUBION解析(URL,TCPIpH.NSnType Type A);然后轮询untClpPidNSsIsAdvices(Surviv-G.;PARAMS & Gt;URL,(IPX MululyAdvult*)和AdDR,IpAddiSrsSype Type IPv4);有什么深不可测的理由吗?

以上来自于百度翻译


      以下为原文

    Why is my dns resolving to 0.0.0.0?

It is called like this

char * URL = "www.google.com";
IPV4_ADDR addr;
dnsres = TCPIP_DNS_Resolve(URL, TCPIP_DNS_TYPE_A);

then polled until

TCPIP_DNS_IsResolved(stream->params->URL, (IP_MULTI_ADDRESS*) &addr, IP_ADDRESS_TYPE_IPV4); returns TCPIP_DNS_RES_OK


Do I have to enable the dns server in hARMony for some unfathomable reason?

回帖(8)

刘涛

2019-1-17 13:54:36
为什么这样做?如果有IPv6条目,它将永远不会返回IPv4的任何东西!???DNS中的822到844行

以上来自于百度翻译


      以下为原文

    Why is this done this way?  It will never return anything for ipv4 if there is an ipv6 entry!!?
 
Lines 822 to 844 in dns.c @ _DNS_IsNameResolved
 
    if(nIPv6Entries || nIPv4Entries)
    {
        if(nIPv6Entries)
        {
            if(hostIPv6)
            {
                memcpy (hostIPv6->v, pDnsHE->pip6Address + nIPv6Entries - 1, sizeof (IPV6_ADDR));
            }
            if(singleAddress)
            { // retrieve only one address
                nIPv4Entries = 0;
            }
        }

        if(nIPv4Entries)
        {
            if(hostIPv4)
            { // get the 0th location of the address
                hostIPv4->Val = (pDnsHE->pip4Address + 0)->Val;
            }
        }
        return TCPIP_DNS_RES_OK;
    }
 
 
 
举报

李子跃

2019-1-17 14:08:26
只有单地址是真的吗?这套电视机在哪里?

以上来自于百度翻译


      以下为原文

   
Only if singleAddress is true? Where is this set?
举报

刘涛

2019-1-17 14:13:50
当TCPIpIdDNSISISCORDEVALIDCALDSIDSNSISNAMESELVIEDLIN 756=返回ONDSNSISN(主机名、HOSTIVPV4、HOTIFPV6、TRUE)时,该框架在框架中自动设置;

以上来自于百度翻译


      以下为原文

    This is set automatically in the framework when TCPIP_DNS_IsResolved calls _DNS_IsNameResolved
 
line 756 = return _DNS_IsNameResolved(hostName, hostIPv4, hostIPv6, true);
举报

刘涛

2019-1-17 14:19:23
如果我把它改为NIPV4条目=1,它会起作用,不过我想解释一下。

以上来自于百度翻译


      以下为原文

    It works as expected if I change it to nIPv4Entries = 1;
 
I'd like some explanation though.
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分