Skip to content

Commit

Permalink
Ethernet begin with static IP - set DNS with interface name
Browse files Browse the repository at this point in the history
  • Loading branch information
JAndrassy committed Apr 4, 2024
1 parent d53db7a commit dd866da
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 dd866da

Please sign in to comment.