Export (0) Print
Expand All

DNS_RECORD structure

The DNS_RECORD structure stores a DNS resource record (RR).

Syntax


typedef struct _DnsRecord {
  DNS_RECORD *pNext;
  PWSTR      pName;
  WORD       wType;
  WORD       wDataLength;
  union {
    DWORD            DW;
    DNS_RECORD_FLAGS S;
  } Flags;
  DWORD      dwTtl;
  DWORD      dwReserved;
  union {
    DNS_A_DATA      A;
    DNS_SOA_DATA    SOA, Soa;
    DNS_PTR_DATA    PTR, Ptr, NS, Ns, CNAME, Cname, DNAME, Dname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr;
    DNS_MINFO_DATA  MINFO, Minfo, RP, Rp;
    DNS_MX_DATA     MX, Mx, AFSDB, Afsdb, RT, Rt;
    DNS_TXT_DATA    HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25;
    DNS_NULL_DATA   Null;
    DNS_WKS_DATA    WKS, Wks;
    DNS_AAAA_DATA   AAAA;
    DNS_KEY_DATA    KEY, Key;
    DNS_SIG_DATA    SIG, Sig;
    DNS_ATMA_DATA   ATMA, Atma;
    DNS_NXT_DATA    NXT, Nxt;
    DNS_SRV_DATA    SRV, Srv;
    DNS_NAPTR_DATA  NAPTR, Naptr;
    DNS_OPT_DATA    OPT, Opt;
    DNS_DS_DATA     DS, Ds;
    DNS_RRSIG_DATA  RRSIG, Rrsig;
    DNS_NSEC_DATA   NSEC, Nsec;
    DNS_DNSKEY_DATA DNSKEY, Dnskey;
    DNS_TKEY_DATA   TKEY, Tkey;
    DNS_TSIG_DATA   TSIG, Tsig;
    DNS_WINS_DATA   WINS, Wins;
    DNS_WINSR_DATA    WINSR, WinsR, NBSTAT, Nbstat;
    DNS_DHCID_DATA    DHCID;
  } Data;
} DNS_RECORD, *PDNS_RECORD;

Members

pNext

A pointer to the next DNS_RECORD structure.

pName

A pointer to a string that represents the domain name of the record set. This must be in the string format that corresponds to the function called, such as ANSI, Unicode, or UTF8.

wType

A value that represents the RR DNS Record Type. wType determines the format of Data. For example, if the value of wType is DNS_TYPE_A, the data type of Data is DNS_A_DATA.

wDataLength

The length, in bytes, of Data. For fixed-length data types, this value is the size of the corresponding data type, such as sizeof(DNS_A_DATA). For the non-fixed data types, use one of the following macros to determine the length of the data:


#include <windows.h>

#define DNS_NULL_RECORD_LENGTH(ByteCount) (sizeof(DWORD) + (ByteCount))
#define DNS_WKS_RECORD_LENGTH(ByteCount) (sizeof(DNS_WKS_DATA) + (ByteCount-1))
#define DNS_WINS_RECORD_LENGTH(IpCount) (sizeof(DNS_WINS_DATA) + ((IpCount-1) * sizeof(IP_ADDRESS)))
#define DNS_TEXT_RECORD_LENGTH(StringCount) (sizeof(DWORD) + ((StringCount) * sizeof(PCHAR)))


Flags
DW

A value that contains a bitmap of DNS Record Flags.

S

A set of flags in the form of a DNS_RECORD_FLAGS structure.

dwTtl

The DNS RR's Time To Live value (TTL), in seconds.

dwReserved

Reserved. Do not use.

Data

The DNS RR data type is determined by wType and is one of the following members:

A

The RR data type is DNS_A_DATA. The value of wType is DNS_TYPE_A.

SOA, Soa

The RR data type is DNS_SOA_DATA. The value of wType is DNS_TYPE_SOA.

PTR, Ptr, NS, Ns, CNAME, Cname, DNAME, Dname, MB, Mb, MD, Md, MF, Mf, MG, Mg, MR, Mr

The RR data type is DNS_PTR_DATA. The value of wType is DNS_TYPE_PTR.

MINFO, Minfo, RP, Rp

The RR data type is DNS_MINFO_DATA. The value of wType is DNS_TYPE_MINFO.

MX, Mx, AFSDB, Afsdb, RT, Rt

The RR data type is DNS_MX_DATA. The value of wType is DNS_TYPE_MX.

HINFO, Hinfo, ISDN, Isdn, TXT, Txt, X25

The RR data type is DNS_TXT_DATA. The value of wType is DNS_TYPE_TEXT.

Null

The RR data type is DNS_NULL_DATA. The value of wType is DNS_TYPE_NULL.

WKS, Wks

The RR data type is DNS_WKS_DATA. The value of wType is DNS_TYPE_WKS.

AAAA

The RR data type is DNS_AAAA_DATA. The value of wType is DNS_TYPE_AAAA.

KEY, Key

The RR data type is DNS_KEY_DATA. The value of wType is DNS_TYPE_KEY.

SIG, Sig

The RR data type is DNS_SIG_DATA. The value of wType is DNS_TYPE_SIG.

ATMA, Atma

The RR data type is DNS_ATMA_DATA. The value of wType is DNS_TYPE_ATMA.

NXT, Nxt

The RR data type is DNS_NXT_DATA. The value of wType is DNS_TYPE_NXT.

SRV, Srv

The RR data type is DNS_SRV_DATA. The value of wType is DNS_TYPE_SRV.

NAPTR, Naptr

The RR data type is DNS_NAPTR_DATA. The value of wType is DNS_TYPE_NAPTR.

OPT, Opt

Windows 7 or later: The RR data type is DNS_OPT_DATA. The value of wType is DNS_TYPE_OPT.

DS, Ds

Windows 7 or later: The RR data type is DNS_DS_DATA. The value of wType is DNS_TYPE_DS.

RRSIG, Rrsig

Windows 7 or later: The RR data type is DNS_RRSIG_DATA. The value of wType is DNS_TYPE_RRSIG.

NSEC, Nsec

Windows 7 or later: The RR data type is DNS_NSEC_DATA. The value of wType is DNS_TYPE_NSEC.

DNSKEY, Dnskey

Windows 7 or later: The RR data type is DNS_DNSKEY_DATA. The value of wType is DNS_TYPE_DNSKEY.

TKEY, Tkey

The RR data type is DNS_TKEY_DATA. The value of wType is DNS_TYPE_TKEY.

TSIG, Tsig

The RR data type is DNS_TSIG_DATA. The value of wType is DNS_TYPE_TSIG.

WINS, Wins

The RR data type is DNS_WINS_DATA. The value of wType is DNS_TYPE_WINS.

WINSR, WinsR, NBSTAT, Nbstat

The RR data type is DNS_WINSR_DATA. The value of wType is DNS_TYPE_WINSR.

DHCID

Windows 7 or later: The RR data type is DNS_DHCID_DATA. The value of wType is DNS_TYPE_DHCID.

Remarks

When building a DNS_RECORD list as an input argument for the various DNS update routines found in the DNS API, all flags in the DNS_RECORD structure should be set to zero.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Windns.h

See also

DnsQuery
DnsExtractRecordsFromMessage
DnsModifyRecordsInSet
DnsRecordCompare
DnsRecordCopyEx
DnsRecordSetCompare
DnsRecordSetDetach
DnsReplaceRecordSet
DNS_A_DATA
DNS_AAAA_DATA
DNS_ATMA_DATA
DNS_DHCID_DATA
DNS_DNSKEY_DATA
DNS_DS_DATA
DNS_KEY_DATA
DNS_LOC_DATA
DNS_MINFO_DATA
DNS_MX_DATA
DNS_NAPTR_DATA
DNS_NSEC_DATA
DNS_NULL_DATA
DNS_NXT_DATA
DNS_OPT_DATA
DNS_PTR_DATA
DNS_RRSIG_DATA
DNS_SIG_DATA
DNS_SOA_DATA
DNS_SRV_DATA
DNS_TKEY_DATA
DNS_TSIG_DATA
DNS_TXT_DATA
DNS_WINS_DATA
DNS_WINSR_DATA
DNS_WKS_DATA

 

 

Community Additions

ADD
Show:
© 2014 Microsoft