1.2.1.8 DNS Server Module

A step-by-step analysis of the DNS Server is as follows:

  • DNS server can be enabled or disabled at run time.

  • If the TCP/IP commands module is built in, it contains a "dnss" command that could be used for interfacing with the DNSS module.

  • A client sends some query to the DNS Server of the TCP/IP stack for a name resolution.

  • The DNS Server of the TCP/IP Stack first checks the configuration value of replyBoardAddr.

    • This Boolean flag is passed to the DNSS module at initialization time.

  • If replyBoardAddr is true, the DNS server will reply to the client query with its own board address.

  • If replyBoardAddr is false, the DNSS will check its cache for an entry for that name.

    • If a valid entry is found, the reply is sent to the client requesting the info.

    • Otherwise no reply is provided.

  • To update the DNSS cache, new entries can be added either using the DNSS API or directly from the console, using the "dnss" command.

  • The dnsserv command is used to add, delete and display the DNS server details

  • Authoritative Name servers and Addition Name servers are not processed.

  • The client may store the answer to the DNS query in it's own cache for future use.

DNSS Figure 1

Abstraction Model

DNSS is part of the Application Layer, as illustrated in the following figure

DNSS_tcpip_stack_diagram

DNSS resolution operations follow a simple state machine, as indicated in the following diagram

dns server flow chart

Library Interface

NameDescription
General Functions
TCPIP_DNSS_AddressCntGetGet DNS Server IPv4 or IPv4 Address count details for the Input value of Index
TCPIP_DNSS_CacheEntryRemoveRemove DNS server cache entry by Hostname and IP Type and IP(v4 or v6) address
TCPIP_DNSS_DisableDisables the DNS Server for the specified interface.
TCPIP_DNSS_EnableEnables the DNS server for the specified interface.
TCPIP_DNSS_EntryAddAdd a IPv4 or IPv6 entry to the DNS server table.
TCPIP_DNSS_IsEnabledDetermines if the DNS Server is enabled on the specified interface.
TCPIP_DNSS_EntryGetGet DNS server IP address details from resolver pool entry.
TCPIP_DNSS_TaskStandard TCP/IP stack module task function.
Data Types and Constants
TCPIP_DNSS_MODULE_CONFIGProvides a place holder for DNS server configuration.
TCPIP_DNSS_RESULTDNS result codes
TCPIP_DNSS_CACHE_MAX_SERVER_ENTRIESMaximum DNS server Cache entries. It is the sum of TCPIP_DNSS_CACHE_PER_IPV4_ADDRESS and TCPIP_DNSS_CACHE_PER_IPV6_ADDRESS.
TCPIP_DNSS_CACHE_PER_IPV4_ADDRESSMaximum and default number of IPv4 entries will be allowed to be configured from command prompt. and these many entries will be allowed to be sent in response for the DNS query with record type TCPIP_DNS_TYPE_A.
TCPIP_DNSS_CACHE_PER_IPV6_ADDRESSMaximum and default number of IPv6 entries will be allowed to be configured from command prompt. and these many entries will be allowed to be sent in response for the DNS query with record type TCPIP_DNS_TYPE_AAAA.
TCPIP_DNSS_HOST_NAME_LENDefault DNS host name length
TCPIP_DNSS_REPLY_BOARD_ADDRReply DNS info with Board info only if the requested DNS host name is not present if TCPIP_DNSS_REPLY_BOARD_ADDR != 1 , then return no such name This is used for a boolean variable . the value should be 0 or 1
TCPIP_DNSS_TASK_PROCESS_RATEDNS Server time out task processing rate, in milliseconds. The DNS Server module will process a timer event with this rate for processing its own state machine, etc. The default value is 33 milliseconds. The lower the rate (higher the frequency) the higher the module priority and higher module performance can be obtained The value cannot be lower than the TCPIP_STACK_TICK_RATE.
TCPIP_DNSS_TTL_TIMEDefault TTL time for a IP address is 10 minutes
__DNSS_HThis is macro __DNSS_H.
DNSS_CONFIG_HThis is macro DNSS_CONFIG_H.