<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SDK Lwip DNS - dns_gethostbyname(), how to let it work with static IP settings in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-Lwip-DNS-dns-gethostbyname-how-to-let-it-work-with-static-IP/m-p/1219917#M12376</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/64110"&gt;@ping1&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Under the DHCP mode, the DNS server is configured correctly by the DHCP server.&lt;/P&gt;
&lt;P&gt;With static mode, you need to set the right DNS server by yourself. You should be very careful. Maybe that is the reason.&lt;/P&gt;
&lt;TABLE class="memberdecls"&gt;
&lt;TBODY&gt;
&lt;TR class="memitem:gaf66c5d8273f83cdc2cdd8911fb68d584"&gt;
&lt;TD align="right" valign="top" class="memItemLeft"&gt;void&amp;nbsp;&lt;/TD&gt;
&lt;TD valign="bottom" class="memItemRight"&gt;&lt;A class="el" href="https://www.nongnu.org/lwip/2_0_x/group__dns.html#gaf66c5d8273f83cdc2cdd8911fb68d584" target="_blank"&gt;dns_setserver&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(u8_t numdns, const&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="el" href="https://www.nongnu.org/lwip/2_0_x/group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a" target="_blank"&gt;ip_addr_t&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;*dnsserver)&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Sat, 23 Jan 2021 07:17:48 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2021-01-23T07:17:48Z</dc:date>
    <item>
      <title>SDK Lwip DNS - dns_gethostbyname(), how to let it work with static IP settings</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-Lwip-DNS-dns-gethostbyname-how-to-let-it-work-with-static-IP/m-p/1217880#M12315</link>
      <description>&lt;P&gt;Hi, all&lt;/P&gt;&lt;P&gt;Try to use the function to resolve IP address from domain names, it works fine when IP setting is configured as DHCP, however when it is configured as STATIC, it doesn't work. It seems use DHCP server as DNS server.&lt;/P&gt;&lt;P&gt;I run lwip on bare metal - not sure there is any alternative function.&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Ping&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 10:59:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-Lwip-DNS-dns-gethostbyname-how-to-let-it-work-with-static-IP/m-p/1217880#M12315</guid>
      <dc:creator>ping1</dc:creator>
      <dc:date>2021-01-20T10:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: SDK Lwip DNS - dns_gethostbyname(), how to let it work with static IP settings</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-Lwip-DNS-dns-gethostbyname-how-to-let-it-work-with-static-IP/m-p/1219917#M12376</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/64110"&gt;@ping1&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Under the DHCP mode, the DNS server is configured correctly by the DHCP server.&lt;/P&gt;
&lt;P&gt;With static mode, you need to set the right DNS server by yourself. You should be very careful. Maybe that is the reason.&lt;/P&gt;
&lt;TABLE class="memberdecls"&gt;
&lt;TBODY&gt;
&lt;TR class="memitem:gaf66c5d8273f83cdc2cdd8911fb68d584"&gt;
&lt;TD align="right" valign="top" class="memItemLeft"&gt;void&amp;nbsp;&lt;/TD&gt;
&lt;TD valign="bottom" class="memItemRight"&gt;&lt;A class="el" href="https://www.nongnu.org/lwip/2_0_x/group__dns.html#gaf66c5d8273f83cdc2cdd8911fb68d584" target="_blank"&gt;dns_setserver&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(u8_t numdns, const&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="el" href="https://www.nongnu.org/lwip/2_0_x/group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a" target="_blank"&gt;ip_addr_t&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;*dnsserver)&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 07:17:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-Lwip-DNS-dns-gethostbyname-how-to-let-it-work-with-static-IP/m-p/1219917#M12376</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2021-01-23T07:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: SDK Lwip DNS - dns_gethostbyname(), how to let it work with static IP settings</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-Lwip-DNS-dns-gethostbyname-how-to-let-it-work-with-static-IP/m-p/1220357#M12389</link>
      <description>&lt;P&gt;Hi, Daniel&lt;/P&gt;&lt;P&gt;Thanks for reply, you are right that DNS server is handled by DHCP server in DHCP mode.&lt;/P&gt;&lt;P&gt;I just wonder how to get it work in static situation, if it needs DNS server IP address , is there a way to tell the LWIP? will it still work? Any examples?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ping&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 08:30:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-Lwip-DNS-dns-gethostbyname-how-to-let-it-work-with-static-IP/m-p/1220357#M12389</guid>
      <dc:creator>ping1</dc:creator>
      <dc:date>2021-01-25T08:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: SDK Lwip DNS - dns_gethostbyname(), how to let it work with static IP settings</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-Lwip-DNS-dns-gethostbyname-how-to-let-it-work-with-static-IP/m-p/1220360#M12390</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/64110"&gt;@ping1&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;First you need to know the right DNS server in your network, for example, 1.1.1.1&lt;/P&gt;
&lt;P&gt;Please refer to below code.&lt;/P&gt;
&lt;PRE&gt;#include "lwip/dns.h"

ip_addr_t dnsServerIp;
IP_ADDR4( &amp;amp;dnsServerIp, "1.1.1.1");
dns_setserver(0, &amp;amp;dnsServerIp);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Regards&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 08:38:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/SDK-Lwip-DNS-dns-gethostbyname-how-to-let-it-work-with-static-IP/m-p/1220360#M12390</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2021-01-25T08:38:52Z</dc:date>
    </item>
  </channel>
</rss>

