@@ -41,6 +41,8 @@ int EthernetClass::begin(void)
4141 w5500.setGatewayIp (_dhcp->getGatewayIp ().raw_address ());
4242 w5500.setSubnetMask (_dhcp->getSubnetMask ().raw_address ());
4343 _dnsServerAddress = _dhcp->getDnsServerIp ();
44+ _dnsDomainName = _dhcp->getDnsDomainName ();
45+ _hostName = _dhcp->getHostName ();
4446 }
4547
4648 return ret;
@@ -100,6 +102,8 @@ int EthernetClass::begin(uint8_t *mac_address)
100102 w5500.setGatewayIp (_dhcp->getGatewayIp ().raw_address ());
101103 w5500.setSubnetMask (_dhcp->getSubnetMask ().raw_address ());
102104 _dnsServerAddress = _dhcp->getDnsServerIp ();
105+ _dnsDomainName = _dhcp->getDnsDomainName ();
106+ _hostName = _dhcp->getHostName ();
103107 }
104108
105109 return ret;
@@ -157,6 +161,8 @@ int EthernetClass::maintain(){
157161 w5500.setGatewayIp (_dhcp->getGatewayIp ().raw_address ());
158162 w5500.setSubnetMask (_dhcp->getSubnetMask ().raw_address ());
159163 _dnsServerAddress = _dhcp->getDnsServerIp ();
164+ _dnsDomainName = _dhcp->getDnsDomainName ();
165+ _hostName = _dhcp->getHostName ();
160166 break ;
161167 default :
162168 // this is actually a error, it will retry though
@@ -192,4 +198,12 @@ IPAddress EthernetClass::dnsServerIP()
192198 return _dnsServerAddress;
193199}
194200
201+ char * EthernetClass::dnsDomainName (){
202+ return _dnsDomainName;
203+ }
204+
205+ char * EthernetClass::hostName (){
206+ return _hostName;
207+ }
208+
195209EthernetClass Ethernet;
0 commit comments