typedef struct
{
unsigned short TransactionID;
/
/
交易
ID
,发出和接收必须相同
unsigned short Flags;
/
/
标志字段,发出和接收都应该修改该字段
unsigned short Questions;
/
/
问题格式
unsigned short AnswerRRS;
/
/
回答资源记录个数
unsigned short AuthorityRRS;
/
/
认证资源记录个数
unsigned short AdditionalRRS;
/
/
附加资源记录个数
}DNSHEADER,
*
LPDNSHEADER;
/
/
中间的要解析的名称以一个非可打印字符开头,以
0
结尾,后面紧跟着解析的类型要求,和CLASS要求
typedef struct
{
unsigned short Name;
/
/
名称,低字节为从开头的偏移地址,只想要解析的内容
unsigned short
Type
;
/
/
类型,
0005
为解析字符串,
0001
为解析IP地址
unsigned short Class;
/
/
输入
unsigned short HighTTL;
/
/
生存周期
unsigned short LowTTL;
unsigned short AddrLen;
/
/
解析的长度
unsigned
int
Address;
/
/
解析的内容
}DNSANSWER,
*
LPDNSANSWER;
typedef struct
{
unsigned short Name;
/
/
名称,低字节为从开头的偏移地址,只想要解析的内容
unsigned short
Type
;
/
/
类型,
0005
为解析字符串,
0001
为解析IP地址
unsigned short Class;
/
/
输入
unsigned short HighTTL;
/
/
生存周期
unsigned short LowTTL;
unsigned short AddrLen;
/
/
解析的长度
unsigned char Address[
16
];
/
/
解析的内容
}DNSANSWERIPV6,
*
LPDNSANSWERIPV6;
typedef struct {
unsigned short dnstype;
unsigned short dnsclass;
}DNSTYPECLASS,
*
LPDNSTYPECLASS;
typedef struct {
unsigned short Name;
unsigned short
Type
;
unsigned short Class;
unsigned
int
TTL;
unsigned short AddrLen;
}DNSANSWERHEADER,
*
LPDNSANSWERHEADER;