lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] failed to resolve dns


From: Bas Prins
Subject: Re: [lwip-users] failed to resolve dns
Date: Mon, 27 Jun 2022 22:09:12 +0200

Hi Jeff,
Thx a lot! Works like a charm.

best regards, bas

Op ma 27 jun. 2022 om 21:48 schreef Thompson, Jeff <JeffThompson@invue.com>:

Drop the https:// part of the request.

 

Jeff Thompson  |  Senior Electrical Engineer - Firmware
+1 704 752 6513 x1394
www.invue.com

 

From: lwip-users <lwip-users-bounces+jeffthompson=invue.com@nongnu.org> On Behalf Of Bas Prins
Sent: Monday, June 27, 2022 3:35 PM
To: Mailing list for lwIP users <lwip-users@nongnu.org>
Subject: [lwip-users] failed to resolve dns

 

Hi,

 

I am trying to use the DNS lookup in the http client but lwip tells me it failed to resolve hostname.

 

I am using the following code

 

        ip_addr_t dns_ip;

        IP4_ADDR(&dns_ip, 8, 8, 8, 8);

 

        dns_setserver(0, &dns_ip);

 

        _settings.result_fn = DownloadFinshedCallback;

 

        LOCK_TCPIP_CORE();

        err_t err = httpc_get_file_dns(

            "http://www.google.nl",

            8000,

            url,

            &_settings,

            HttpPacketReceivedCallback,

            this,

            nullptr);

        UNLOCK_TCPIP_CORE();

 

 

8.8.8.8 is a DNS server from google. I also tried the actual DNS server from my provider. Both result in the same behavior.

 

Which gives the following logging output:

 

[21:27:33:731] dns_enqueue: "http://www.google.nl": use DNS entry 0

[21:27:33:735] dns_enqueue: "http://www.google.nl": use DNS pcb 0

[21:27:33:741] dns_send: dns_servers[0] "http://www.google.nl": request

[21:27:33:746] sending DNS request ID 23300 for name "http://www.google.nl" to server 0␍␊

[21:27:33:751] pppos_netif_output[0]: proto=0x21, len = 66

[21:27:33:754] [Download] : Downloading file from server...

[21:27:33:894] pppos_netif_output[0]: proto=0x21, len = 40

[21:27:33:958] tcpip_thread: PACKET 0x20018f4c

[21:27:33:962] pppos_input[0]: ]: got 11 bytes

[21:27:33:962] tcpip_thread: PACKET 0x20018f4c

[21:27:33:967] pppos_input[0]: got 64 bytes

[21:27:33:968] tcpip_thread: PACKET 0x20018f4c

[21:27:33:972] pppos_input[0]: got 57 bytes

[21:27:33:973] pppos_input

[21:27:33:975] ppp_input[0]: ip in pbuf len=126

[21:27:33:977] dns_recv: "http://www.google.nl": error in flags

[21:27:33:981] httpc_dns_found: failed to resolve hostname: http://www.google.nl

 

I can download files using http_client fine when I just hard code the IP addresses. Is there anything fundamentally wrong with what I am doing?

 

Any tips maybe to help me on my way?

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

[Prev in Thread] Current Thread [Next in Thread]