Skip to Main Content
DNS on Windows 2000, Second Edition
book

DNS on Windows 2000, Second Edition

by Matt Larson, Cricket Liu
September 2001
Intermediate to advanced content levelIntermediate to advanced
352 pages
11h 1m
English
O'Reilly Media, Inc.
Content preview from DNS on Windows 2000, Second Edition

DNS Messages

To write programs that parse DNS messages, you need to understand the message format. DNS queries and responses are most often contained within UDP datagrams. Each message is fully contained within a UDP datagram. If the query and response are sent over TCP, they are prefixed with a 2-byte value indicating the length of the query or response, excluding the 2-byte length. The format and content of the DNS message are as follows.

Message Format

(From RFC 1035, page 25)

All communications inside of the domain protocol are carried in a single format called a message. The top level format of the message is divided into 5 sections (some of which are empty in certain cases), shown below:

    +---------------------+
    |        Header       |
    +---------------------+
    |       Question      | the question for the name server
    +---------------------+
    |        Answer       | RRs answering the question
    +---------------------+
    |      Authority      | RRs pointing toward an authority
    +---------------------+
    |      Additional     | RRs holding additional information
    +---------------------+

The Header section is always present. The header includes fields that specify which of the remaining sections are present, and also specify whether the message is a query or a response, a standard query or some other opcode, etc.

The names of the sections after the header are derived from their use in standard queries. The Question section contains fields that describe a question to a name server. These fields are a query type (QTYPE), a query class (QCLASS), ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

DNS on Windows Server 2003, 3rd Edition

DNS on Windows Server 2003, 3rd Edition

Cricket Liu, Matt Larson, Robbie Allen
VMware vSphere Troubleshooting

VMware vSphere Troubleshooting

Muhammad Zeeshan Munir
Windows NT TCP/IP Network Administration

Windows NT TCP/IP Network Administration

Craig Hunt, Robert Bruce Thompson

Publisher Resources

ISBN: 0596002300Supplemental ContentCatalog PageErrata