summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/lwip/wget.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/lwip/wget.c b/net/lwip/wget.c
index 3c39a1b59a6..f9af2fc0d2b 100644
--- a/net/lwip/wget.c
+++ b/net/lwip/wget.c
@@ -461,6 +461,10 @@ int wget_do_request(ulong dst_addr, char *uri)
if (!netif)
return -1;
+ /* if URL with hostname init dns */
+ if (!ipaddr_aton(ctx.server_name, NULL) && net_lwip_dns_init())
+ return CMD_RET_FAILURE;
+
memset(&conn, 0, sizeof(conn));
#if CONFIG_IS_ENABLED(WGET_HTTPS)
if (is_https) {