Modules | |
DNS Record Types | |
DNS Return Codes | |
Functions | |
int | GetHostByName4 (const char *name, IPADDR4 *pIpaddr, IPADDR4 dns_server, uint16_t timeout, uint16_t TYPE=DNS_A) |
Get the IPv4 address associated with the specified domain name. More... | |
int | GetHostByName6 (const char *name, IPADDR *pIpaddr, const IPADDR &dns_server, uint16_t timeout, uint16_t TYPE1=DNS_A, uint16_t TYPE2=DNS_AAAA) |
Get the IPv6 address associated with the specified domain name. More... | |
int GetHostByName4 | ( | const char * | name, |
IPADDR4 * | pIpaddr, | ||
IPADDR4 | dns_server, | ||
uint16_t | timeout, | ||
uint16_t | TYPE = DNS_A |
||
) |
Get the IPv4 address associated with the specified domain name.
Calling GetHostByName() in dual stack mode will automatically call the correct IPv4 or IPv6 function
*name | Pointer to domain name to resolve |
*pIpaddr | Pointer to variable of type IPADDR4 to store resultant IP address |
&dns_derver | Specified the DNS server to use. Pass INADDR_ANY to use the DNS server associated with the interface |
timeout | Time to wait for the DNS response, specified in TICKS_PER_SECOND |
TYPE1 | Optional DNS record type. If no type is specified the default is IPv4 DNS_A |
int GetHostByName6 | ( | const char * | name, |
IPADDR * | pIpaddr, | ||
const IPADDR & | dns_server, | ||
uint16_t | timeout, | ||
uint16_t | TYPE1 = DNS_A , |
||
uint16_t | TYPE2 = DNS_AAAA |
||
) |
Get the IPv6 address associated with the specified domain name.
Calling GetHostByName() in dual stack mode will automatically call the correct IPv4 or IPv6 function.
The function will attempt to retrieve record type 1 first. If successful the function returns. If if the attempt using type 1 fails, the function will attempt to get a record using the type 2 parameter. For example, lets say you wish your code to use IPv6, but its OK to fall back to IPv4. You can set type 1 to DNS_AAAA and type2 to DNS_A.
*name | Pointer to domain name to resolve |
*pIpaddr | Pointer to variable of type IPADDR4 to store resultant IP address |
&dns_derver | Specified the DNS server to use. Pass INADDR_ANY to use the DNS server associated with the interface. |
timeout | Time to wait for the DNS response, specified in TICKS_PER_SECOND |
TYPE1 | Optional record type. If not specified will default to IPv4 DNS_A |
TYPE2 | Optional record type. If not specified will default to IPv6 DNS_AAAA |