DNS Client API. Utilizing DNS Functionality Baseline Application Kernel, Stack, BSP DNS Integral...

Post on 23-Dec-2015

212 views 0 download

Transcript of DNS Client API. Utilizing DNS Functionality Baseline Application Kernel, Stack, BSP DNS Integral...

DNS Client API

Utilizing DNS Functionality

BaselineApplicationKernel, Stack, BSP

DNS Integral

•DNSAddServer()

•DNSRemoveServer()

•DNSGetServers()

•DNSgethostbyname()

Get an IP Address Based on Host Name

Supplied API’s

Typical DNS Implementation

•Informs Stack of DNS Server(s)•Via DHCP or Direct Call

•Returns an IP address if Successful

DNSAddServer(ULONG IP_Address)

DNSgethostbyname(char *name)

Getting DNS Server IP Addresses

• Use DNSGetServers to retrieve list of DNS servers:

int DNSGetServers( unsigned long *IpAddrs, int nArraySize )

Server count

• Up to 3 DNS server IP addresses are returned in the IpAddrs array (which should therefore usually have 3 elements).

• Returns number of DNS servers, or –1 for failure.

• This function is especially useful when the DHCP client is used.

IP address array (3 elements)

Size of supplied IP address array