Skip to content

Commit dd866da

Browse files
committed
Ethernet begin with static IP - set DNS with interface name
1 parent d53db7a commit dd866da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/Ethernet/src/Ethernet.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ int arduino::EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns, IPA
5555

5656
eth_if->set_dhcp(false);
5757
eth_if->set_network(_ip, _netmask, _gateway);
58-
eth_if->add_dns_server(_dnsServer1, nullptr);
58+
char if_name[5];
59+
eth_if->get_interface_name(if_name);
60+
eth_if->add_dns_server(_dnsServer1, if_name);
5961

6062
auto ret = _begin(mac, timeout, responseTimeout);
6163
return ret;

0 commit comments

Comments
 (0)