STM32Ethernet
Arduino Ethernet library for STM32 boards
Loading...
Searching...
No Matches
DNSClient Class Reference

#include <Dns.h>

Public Member Functions

void begin (const IPAddress &aDNSServer)
 Sets the DNS server used for host name lookups.
 
int inet_aton (const char *address, IPAddress &result)
 Converts a dotted-decimal IP address string to an IP address.
 
int getHostByName (const char *aHostname, IPAddress &aResult)
 Resolves a host name to an IP address.
 

Protected Member Functions

uint16_t BuildRequest (const char *aName)
 Deprecated. Does nothing.
 
uint16_t ProcessResponse (uint16_t aTimeout, IPAddress &aAddress)
 Deprecated. Does nothing.
 

Protected Attributes

IPAddress iDNSServer
 

Member Function Documentation

◆ begin()

void DNSClient::begin ( const IPAddress &  aDNSServer)

Sets the DNS server used for host name lookups.

Passes the server to the LwIP DNS resolver. Has no effect if DHCP has already started.

Parameters
aDNSServerDNS server address.

◆ BuildRequest()

uint16_t DNSClient::BuildRequest ( const char *  aName)
protected

Deprecated. Does nothing.

Deprecated:
Do not use.
Parameters
aNameUnused.
Returns
Always 0.

◆ getHostByName()

int DNSClient::getHostByName ( const char *  aHostname,
IPAddress &  aResult 
)

Resolves a host name to an IP address.

A numeric address string is converted directly. Otherwise the name is resolved through the DNS server set with begin().

Parameters
aHostnameHost name or numeric address to resolve.
aResultIPAddress that receives the resolved address.
Returns
1 on success. -2 if no valid DNS server is set. Otherwise the error code of the resolver: -1 on timeout, -2 if no address was found, or -4 on an LwIP error.

◆ inet_aton()

int DNSClient::inet_aton ( const char *  address,
IPAddress &  result 
)

Converts a dotted-decimal IP address string to an IP address.

Parameters
addressIP address string to convert, in the form "a.b.c.d" with each part in the range 0 to 255.
resultIPAddress that receives the converted address. It may be partly written even if the conversion fails.
Returns
1 if the string was converted, 0 otherwise.

◆ ProcessResponse()

uint16_t DNSClient::ProcessResponse ( uint16_t  aTimeout,
IPAddress &  aAddress 
)
protected

Deprecated. Does nothing.

Deprecated:
Do not use.
Parameters
aTimeoutUnused.
aAddressUnused.
Returns
Always -10, cast to uint16_t.

Member Data Documentation

◆ iDNSServer

IPAddress DNSClient::iDNSServer
protected

The documentation for this class was generated from the following files: