Windows Dev Center

DNS Constants

The following constants are defined for DNS in host byte order.

DNS Record Types

ConstantValue
DNS_TYPE_A0x0001
DNS_TYPE_NS0x0002
DNS_TYPE_MD0x0003
DNS_TYPE_MF0x0004
DNS_TYPE_CNAME0x0005
DNS_TYPE_SOA0x0006
DNS_TYPE_MB0x0007
DNS_TYPE_MG0x0008
DNS_TYPE_MR0x0009
DNS_TYPE_NULL0x000a
DNS_TYPE_WKS0x000b
DNS_TYPE_PTR0x000c
DNS_TYPE_HINFO0x000d
DNS_TYPE_MINFO0x000e
DNS_TYPE_MX0x000f
DNS_TYPE_TEXT0x0010
DNS_TYPE_RP0x0011
DNS_TYPE_AFSDB0x0012
DNS_TYPE_X250x0013
DNS_TYPE_ISDN0x0014
DNS_TYPE_RT0x0015
DNS_TYPE_NSAP0x0016
DNS_TYPE_NSAPPTR0x0017
DNS_TYPE_SIG0x0018
DNS_TYPE_KEY0x0019
DNS_TYPE_PX0x001a
DNS_TYPE_GPOS0x001b
DNS_TYPE_AAAA0x001c
DNS_TYPE_LOC0x001d
DNS_TYPE_NXT0x001e
DNS_TYPE_EID0x001f
DNS_TYPE_NIMLOC0x0020
DNS_TYPE_SRV0x0021
DNS_TYPE_ATMA0x0022
DNS_TYPE_NAPTR0x0023
DNS_TYPE_KX0x0024
DNS_TYPE_CERT0x0025
DNS_TYPE_A60x0026
DNS_TYPE_DNAME0x0027
DNS_TYPE_SINK0x0028
DNS_TYPE_OPT0x0029
DNS_TYPE_DS0x002B
DNS_TYPE_RRSIG0x002E
DNS_TYPE_NSEC0x002F
DNS_TYPE_DNSKEY0x0030
DNS_TYPE_DHCID0x0031
DNS_TYPE_UINFO0x0064
DNS_TYPE_UID0x0065
DNS_TYPE_GID0x0066
DNS_TYPE_UNSPEC0x0067
DNS_TYPE_ADDRS0x00f8
DNS_TYPE_TKEY0x00f9
DNS_TYPE_TSIG0x00fa
DNS_TYPE_IXFR0x00fb
DNS_TYPE_AXFR0x00fc
DNS_TYPE_MAILB0x00fd
DNS_TYPE_MAILA0x00fe
DNS_TYPE_ALL0x00ff
DNS_TYPE_ANY0x00ff
DNS_TYPE_WINS0xff01
DNS_TYPE_WINSR0xff02
DNS_TYPE_NBSTATDNS_TYPE_WINSR

 

DNS Class Types

ConstantValue
DNS_CLASS_INTERNET0x0001
DNS_CLASS_CSNET0x0002
DNS_CLASS_CHAOS0x0003
DNS_CLASS_HESIOD0x0004
DNS_CLASS_NONE0x00fe
DNS_CLASS_ALL0x00ff
DNS_CLASS_ANY0x00ff

 

DNS Query Types

ConstantValue
DNS_OPCODE_QUERY0x0000
DNS_OPCODE_IQUERY0x0001
DNS_OPCODE_SERVER_STATUS0x0002
DNS_OPCODE_UNKNOWN0x0003
DNS_OPCODE_NOTIFY0x0004
DNS_OPCODE_UPDATE0x0005

 

DNS Record Flags

The following flags refer to a resource record's (RR) section within a DNS message:

ConstantValueMeaning
DNSREC_QUESTION0x00000000RR is in the question section
DNSREC_ANSWER0x00000001RR is in the answer section
DNSREC_AUTHORITY0x00000002RR is in the authority section
DNSREC_ADDITIONAL0x00000003RR is in the additional section

 

The following flags refer to a RR's section within an update DNS message per RFC 2136:

ConstantValueMeaning
DNSREC_ZONE0x00000000RR is in the zone section
DNSREC_PREREQ0x00000001RR is in the prerequisite section
DNSREC_UPDATE0x00000002RR is in the update section

 

The following flags are mutually exclusive:

ConstantValueMeaning
DNSREC_DELETE0x00000004Delete a RR. Used in conjunction with DNSREC_UPDATE
DNSREC_NOEXIST0x00000004RR does not exist. Used in conjunction with DNSREC_PREREQ

 

DNS Query Options

ConstantValueMeaning
DNS_QUERY_STANDARD0x00000000Standard query.
DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE0x00000001Returns truncated results. Does not retry under TCP.
DNS_QUERY_USE_TCP_ONLY0x00000002Uses TCP only for the query.
DNS_QUERY_NO_RECURSION0x00000004Directs the DNS server to perform an iterative query (specifically directs the DNS server not to perform recursive resolution to resolve the query).
DNS_QUERY_BYPASS_CACHE0x00000008Bypasses the resolver cache on the lookup.
DNS_QUERY_NO_WIRE_QUERY0x00000010Directs DNS to perform a query on the local cache only.

Windows 2000 Server and Windows 2000 Professional:  This value is not supported. For similar functionality, use DNS_QUERY_CACHE_ONLY.

DNS_QUERY_NO_LOCAL_NAME0x00000020Directs DNS to ignore the local name.

Windows 2000 Server and Windows 2000 Professional:  This value is not supported.

DNS_QUERY_NO_HOSTS_FILE0x00000040Prevents the DNS query from consulting the HOSTS file.

Windows 2000 Server and Windows 2000 Professional:  This value is not supported.

DNS_QUERY_NO_NETBT0x00000080Prevents the DNS query from using NetBT for resolution.

Windows 2000 Server and Windows 2000 Professional:  This value is not supported.

DNS_QUERY_WIRE_ONLY0x00000100Directs DNS to perform a query using the network only, bypassing local information.

Windows 2000 Server and Windows 2000 Professional:  This value is not supported.

DNS_QUERY_RETURN_MESSAGE0x00000200Directs DNS to return the entire DNS response message.

Windows 2000 Server and Windows 2000 Professional:  This value is not supported.

DNS_QUERY_MULTICAST_ONLY0x00000400Prevents the query from using DNS and uses only Local Link Multicast Name Resolution (LLMNR).

Windows Vista and Windows Server 2008 or later.:  This value is supported.

DNS_QUERY_NO_MULTICAST0x00000800
DNS_QUERY_TREAT_AS_FQDN0x00001000Prevents the DNS response from attaching suffixes to the submitted name in a name resolution process.
DNS_QUERY_ADDRCONFIG0x00002000Windows 7 only: Do not send A type queries if IPv4 addresses are not available on an interface and do not send AAAA type queries if IPv6 addresses are not available.
DNS_QUERY_DUAL_ADDR0x00004000Windows 7 only: Query both AAAA and A type records and return results for each. Results for A type records are mapped into AAAA type.
DNS_QUERY_MULTICAST_WAIT0x00020000Waits for a full timeout to collect all the responses from the Local Link. If not set, the default behavior is to return with the first response.

Windows Vista and Windows Server 2008 or later.:  This value is supported.

DNS_QUERY_MULTICAST_VERIFY0x00040000Directs a test using the local machine hostname to verify name uniqueness on the same Local Link. Collects all responses even if normal LLMNR Sender behavior is not enabled.

Windows Vista and Windows Server 2008 or later.:  This value is supported.

DNS_QUERY_DONT_RESET_TTL_VALUES0x00100000If set, and if the response contains multiple records, records are stored with the TTL corresponding to the minimum value TTL from among all records. When this option is set, "Do not change the TTL of individual records" in the returned record set is not modified.
DNS_QUERY_DISABLE_IDN_ENCODING0x00200000Disables International Domain Name (IDN) encoding support in the DnsQuery, DnsQueryEx, DnsModifyRecordsInSet, and DnsReplaceRecordSet APIs. All punycode names are treated as ASCII and will be ASCII encoded on the wire. All non-ASCII names are encoded in UTF8 on the wire.

Windows 8 or later.:  This value is supported.

DNS_QUERY_APPEND_MULTILABEL0x00800000
DNS_QUERY_RESERVED0xf0000000Reserved.

 

DNS Update Options

ConstantValueMeaning
DNS_UPDATE_SECURITY_USE_DEFAULT0x00000000Uses the default behavior, which is specified in the registry, for secure dynamic DNS updates.
DNS_UPDATE_SECURITY_OFF0x00000010Does not attempt secure dynamic updates.
DNS_UPDATE_SECURITY_ON0x00000020Attempts non-secure dynamic update; if refused, attempts secure dynamic update.
DNS_UPDATE_SECURITY_ONLY0x00000100Attempts secure dynamic updates only.
DNS_UPDATE_CACHE_SECURITY_CONTEXT0x00000200Caches the security context for use in future transactions.
DNS_UPDATE_TEST_USE_LOCAL_SYS_ACCT0x00000400Uses credentials of the local computer account.
DNS_UPDATE_FORCE_SECURITY_NEGO0x00000800Does not use cached security context.
DNS_UPDATE_TRY_ALL_MASTER_SERVERS0x00001000Sends DNS updates to all multi-master DNS servers.
DNS_UPDATE_SKIP_NO_UPDATE_ADAPTERS0x00002000Do not update adapters where dynamic DNS updates are disabled.

Windows 2000 Server with SP2 or later.:  This value is supported.

DNS_UPDATE_REMOTE_SERVER0x00004000Register CNAME records on a remote server in addition to the local DNS server.

Windows 2000 Server with SP2 or later.:  This value is supported.

DNS_UPDATE_RESERVED0xffff0000Reserved for future use.

 

DNS Response Codes

ErrorMeaning
DNS_RCODE_NOERRORNo error
DNS_RCODE_FORMERRFormat error
DNS_RCODE_SERVFAILServer failure
DNS_RCODE_NXDOMAINName error
DNS_RCODE_NOTIMPLNot implemented
DNS_RCODE_REFUSEDConnection refused
DNS_RCODE_YXDOMAINDomain name should not exist
DNS_RCODE_YXRRSETResource Record (RR) set should not exist
DNS_RCODE_NXRRSETRR set does not exist
DNS_RCODE_NOTAUTHNot authoritative for zone
DNS_RCODE_NOTZONEName not in zone
DNS_RCODE_BADVERSBad Extension Mechanism for DNS (EDNS) version
DNS_RCODE_BADSIGBad signature
DNS_RCODE_BADKEYBad key
DNS_RCODE_BADTIMEBad timestamp

 

 

 

Community Additions

ADD
Show:
© 2015 Microsoft