File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 2222#include " Ethernet.h"
2323#include " utility/w5100.h"
2424#include " Dhcp.h"
25+ #include " Dns.h"
2526
2627IPAddress EthernetClass::_dnsServerAddress;
2728DhcpClass* EthernetClass::_dhcp = NULL ;
@@ -224,6 +225,13 @@ void EthernetClass::setRetransmissionCount(uint8_t num)
224225 SPI.endTransaction ();
225226}
226227
228+ int EthernetClass::hostByName (const char * hostname, IPAddress& result)
229+ {
230+ int ret = 0 ;
231+ DNSClient dns;
232+ dns.begin (_dnsServerAddress);
233+ return dns.getHostByName (hostname, result);
234+ }
227235
228236
229237
Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ class EthernetClass {
105105 void setRetransmissionTimeout (uint16_t milliseconds);
106106 void setRetransmissionCount (uint8_t num);
107107
108+ int hostByName (const char * hostname, IPAddress& result);
109+
108110 friend class EthernetClient ;
109111 friend class EthernetServer ;
110112 friend class EthernetUDP ;
You can’t perform that action at this time.
0 commit comments