SYNAPSE - Synchronous TCP/IP Library for Delphi
Other related information can be found at http://www.mlp.cz/space/gebauerl/synapse/
Class: TDNSPSend
- Properties:
- Timeout:integer
Define timeout in second for all DNS operations. Default value is 5 seconds.
- DNShost:String
Address of DNS server (IP address or domain name) where you want to query.
- RCode:integer
After DNS operation contains ResultCode of DNS operation. Values are: 0-no error, 1-format error, 2-server failure, 3-name error, 4-not implemented, 5-refused.
- Methods:
- Function DNSQuery(Name:string;Qtype:integer;Reply:TStrings):Boolean
Query a DNSHost for QType resources correspond to a name. Supported QType values are: Qtype_A, Qtype_NS, Qtype_MD, Qtype_MF, Qtype_CNAME, Qtype_SOA, Qtype_MB, Qtype_MG, Qtype_MR, Qtype_NULL, Qtype_PTR, Qtype_HINFO, Qtype_MINFO, Qtype_MX, Qtype_TXT, Qtype_RP, Qtype_AFSDB, Qtype_X25, Qtype_ISDN, Qtype_RT, Qtype_NSAP, Qtype_NSAPPTR, Qtype_PX, Qtype_GPOS, Qtype_KX.
Name is domain name or host name for queryied resource. If name is IP address, automatically convert to reverse domain form (in-addr.arpa).
If result is true, Reply contains resource records. One record on one line. If Resource record have multiple fields, they are stored on line divided by comma. (example: MX record contains value 'rs.cesnet.cz' with preference number 10, string in Reply is: '10,rs.cesnet.cz'). All numbers or IP address in resource are converted to string form.
- Not class (but cohere) functions:
- Function GetMailServers (DNSHost, domain:string; servers:TStringList):Boolean;
This is useful function and example of use TDNSSend object. Use for get mail servers for domain and sort them about its preference numbers. Servers contains only domain names of mail servers in right order (without preference number!). First domain name is maximum preferenced mail server. If all OK, result is TRUE.