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](GUID-CDB7CA24-F904-4EC5-ADA3-954FB56F79E7-low.png)
Abstraction Model
DNSS is part of the Application Layer, as illustrated in the following figure
![DNSS_tcpip_stack_diagram](GUID-6F52FFD0-2AC1-4DB0-998A-6A79E14F4648-low.png)
DNSS resolution operations follow a simple state machine, as indicated in the following diagram
![dns server flow chart](GUID-B2942C6E-1E64-4D0D-9CDF-33C9DB7122ED-low.png)
Library Interface
Name | Description |
---|---|
General Functions | |
TCPIP_DNSS_AddressCntGet | Get DNS Server IPv4 or IPv4 Address count details for the Input value of Index |
TCPIP_DNSS_CacheEntryRemove | Remove DNS server cache entry by Hostname and IP Type and IP(v4 or v6) address |
TCPIP_DNSS_Disable | Disables the DNS Server for the specified interface. |
TCPIP_DNSS_Enable | Enables the DNS server for the specified interface. |
TCPIP_DNSS_EntryAdd | Add a IPv4 or IPv6 entry to the DNS server table. |
TCPIP_DNSS_IsEnabled | Determines if the DNS Server is enabled on the specified interface. |
TCPIP_DNSS_EntryGet | Get DNS server IP address details from resolver pool entry. |
TCPIP_DNSS_Task | Standard TCP/IP stack module task function. |
Data Types and Constants | |
TCPIP_DNSS_MODULE_CONFIG | Provides a place holder for DNS server configuration. |
TCPIP_DNSS_RESULT | DNS result codes |
TCPIP_DNSS_CACHE_MAX_SERVER_ENTRIES | Maximum 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_ADDRESS | Maximum 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_ADDRESS | Maximum 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_LEN | Default DNS host name length |
TCPIP_DNSS_REPLY_BOARD_ADDR | Reply 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_RATE | DNS 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_TIME | Default TTL time for a IP address is 10 minutes |
__DNSS_H | This is macro __DNSS_H. |
DNSS_CONFIG_H | This is macro DNSS_CONFIG_H. |