Skip to content

Commit

Permalink
Merge pull request #860 from JAndrassy/ethernet_static_dns_to_netif
Browse files Browse the repository at this point in the history
Ethernet begin with static IP - set DNS with interface name
  • Loading branch information
pennam authored Apr 19, 2024
2 parents 4930554 + dd866da commit 59ec204
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/Ethernet/src/Ethernet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ int arduino::EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns, IPA

eth_if->set_dhcp(false);
eth_if->set_network(_ip, _netmask, _gateway);
eth_if->add_dns_server(_dnsServer1, nullptr);
char if_name[5];
eth_if->get_interface_name(if_name);
eth_if->add_dns_server(_dnsServer1, if_name);

auto ret = _begin(mac, timeout, responseTimeout);
return ret;
Expand Down

0 comments on commit 59ec204

Please sign in to comment.