ICE_QueryDNS
This DNS resolver function supports 41 different types of DNS RRs (Resource Records) based on various internet RFCs, and includes support for those DNS RRs most commonly used (1/A, 2/NS, 5/CNAME, 6/SOA, 12/PTR, and 15/MX). A clear understanding of DNS is required in order to use this function effectively.
1 = dnsServer is a pointer to an ASCIIZ string (e.g., "127.0.0.1"), instead of a 32-bit (internet order) IP address
2 = rrText is already formatted for DNS communications, instead of a standard ASCIIZ string such as "inter-corporate.com" (see Note 4)
4 = rrType is a pointer to an ASCIIZ string (e.g., "a" or "mx"), instead of a 32-bit type number (see Note 2)
8 = rrClass is a pointer to an ASCIIZ string (e.g., "IN"), instead of a 32-bit class number (see Note 3)
16 = Return raw data (no splicing and no conversion, see Note 5)
32 = If set, calls the function directly instead of starting a thread, thus making it a blocking function (see Note 9 for some important notes about using this flag)
64 = Reserved for future use, set to zero (0) for upward compatibility
128 = Enable recursion (instructs the DNS server to contact the root servers when the answer is not cached locally)
256..2048 = Query type, 4 bits, 0=Query, 1=InverseQuery, 2=Status, all others reserved according to RFC1035
4096..16384 = Z, 3 bits, must be zero for Query types 0 and 1
0 = Successful query
-1 = Unable to allocate memory (malloc() failed)
-2 = Invalid DNS server (dnsServer)
-3 = Invalid UDP port (udpPort)
-4 = Invalid query string (rrText)
-5 = Invalid resource record type (rrType)
-6 = Invalid resource record class (rrClass)
-7 = Socket open or I/O failure
-8 = DNS server returned no response (due to socket read error)
-9 = DNS server returned empty response (no answer)
-10 = DNS server timed out (may be down or UDP packets were lost)
For example, an eMail address of "firstname@example.com" would be represented in DNS as "firstname.example.com" while an eMail address of "firstname.lastname@example.com" would be represented in DNS as "firstname.lastname\.example.com" (when present, the "\." is converted to an "@" symbol).
Remember to use NetWare's free() function when you no longer need the string.