dns client api. utilizing dns functionality baseline application kernel, stack, bsp dns integral...

4
DNS Client API

Upload: laurence-bradford

Post on 23-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DNS Client API. Utilizing DNS Functionality Baseline Application Kernel, Stack, BSP DNS Integral DNSAddServer() DNSRemoveServer() DNSGetServers() DNSgethostbyname()

DNS Client API

Page 2: DNS Client API. Utilizing DNS Functionality Baseline Application Kernel, Stack, BSP DNS Integral DNSAddServer() DNSRemoveServer() DNSGetServers() DNSgethostbyname()

Utilizing DNS Functionality

BaselineApplicationKernel, Stack, BSP

DNS Integral

•DNSAddServer()

•DNSRemoveServer()

•DNSGetServers()

•DNSgethostbyname()

Get an IP Address Based on Host Name

Supplied API’s

Page 3: DNS Client API. Utilizing DNS Functionality Baseline Application Kernel, Stack, BSP DNS Integral DNSAddServer() DNSRemoveServer() DNSGetServers() DNSgethostbyname()

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)

Page 4: DNS Client API. Utilizing DNS Functionality Baseline Application Kernel, Stack, BSP DNS Integral DNSAddServer() DNSRemoveServer() DNSGetServers() DNSgethostbyname()

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