Download Source Code
This sample represents a DNS server that responds with an in-memory list of IPs based on the name submitted.
In short, you need to use the OnGetHandedRecords event of the TclDnsServer component. The event handler may look like the following:
; ARecords: TclDnsRecordList);
rec := TclDnsARecord
Name := AName;
For sure, the complete DNS server should analyze the AName parameter, should add additional DNS records, such as SOA, NS and possible MX.
Please download the complete sample by using the link above.
See also the following article: Simple DNS Server in Delphi
Article ID: 89, Created On: 2/13/2017, Modified: 2/13/2017