Difference between revisions of "Unit DNS"

From Ultibo.org
Jump to: navigation, search
Line 6: Line 6:
  
 
Note: DNS Client is IPv4 based, for IPv6 see new Winsock2 functions
 
Note: DNS Client is IPv4 based, for IPv6 see new Winsock2 functions
 
  
 
See RFC 1035 Section 4 for details
 
See RFC 1035 Section 4 for details

Revision as of 03:07, 9 December 2016

Return to Unit Reference


Description


Note: DNS Client is IPv4 based, for IPv6 see new Winsock2 functions

See RFC 1035 Section 4 for details

Constants



DNS specific constants DNS_*
DNS_TIMEOUT = 5000; We wait for 5 seconds for a DNS reply
DNS_RETRIES = 4; Try the request 4 times
 
DNS_HEADER_SIZE = 12; SizeOf(TDNSHeader);
 
DNS_QUESTION_SIZE = 4; SizeOf(TDNSQuestion);
DNS_RESOURCE_SIZE = 10; SizeOf(TDNSResource); Not including Record Data
 
MAX_DNS_NAME = 255;  
MAX_DNS_LABEL = 63;  
MAX_DNS_MESSAGE = 512; Maximum Size of DNS Message


DNS flag constants DNS_FLAG_*
DNS_FLAG_RESPONSE = $8000; query = 0, response = 1
DNS_FLAG_AUTHORITY = $0400; Authoritative answer
DNS_FLAG_TRUNCATED = $0200; Truncation, response was cut off at 512
DNS_FLAG_DO_RECURSE = $0100; Recursion desired
DNS_FLAG_CAN_RECURSE = $0080; Recursion available


DNS field masks constants DNS_OPCODE_*
DNS_OPCODE_MASK = $7800; Opcode
DNS_RESPONSE_MASK = $000F; Response code


DNS query code constants DNS_QUERY*
DNS_QUERY = 0; A standard query
DNS_INV_QUERY = 1; An inverse query
DNS_COMP_QUERY_MULTI = 2; A completion query, multiple reply (Obsolete)
DNS_COMP_QUERY_SINGLE = 3; A completion query, single reply (Obsolete)


DNS response code constants DNS_NO_*
DNS_NO_ERROR = 0;  
DNS_FORMAT_ERROR = 1;  
DNS_SERVER_FAILURE = 2;  
DNS_NAME_ERROR = 3;  
DNS_NOT_IMPLEMENTED = 4;  
DNS_REFUSED = 5;  


DNS record type constants DNS_TYPE_*
DNS_TYPE_A = 1; Host address resource record (RR)
DNS_TYPE_NS = 2;  
DNS_TYPE_MD = 3;  
DNS_TYPE_MF = 4;  
DNS_TYPE_CNAME = 5;  
DNS_TYPE_SOA = 6;  
DNS_TYPE_MB = 7;  
DNS_TYPE_MG = 8;  
DNS_TYPE_MR = 9;  
DNS_TYPE_RT_NULL = 10;  
DNS_TYPE_WKS = 11;  
DNS_TYPE_PTR = 12; A domain name ptr
DNS_TYPE_HINFO = 13;  
DNS_TYPE_MINFO = 14;  
DNS_TYPE_MX = 15; Mail exchange


DNS address class constants DNS_CLASS_*
DNS_CLASS_IN = 1; ARPA internet class
DNS_CLASS_CS = 2;  
DNS_CLASS_WILD = 255; Wildcard for several of the classifications


DNS message compression constants DNS_POINTER_*
DNS_POINTER_MASK = $C0; Mask to indicate pointer to previously used name


Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

procedure DNSInit;
Description: To be documented
Note None documented


function DNSStart:LongWord;
Description: To be documented
Note None documented


function DNSStop:LongWord;
Description: To be documented
Note None documented


Return to Unit Reference