<s>
DNS	B-Protocol
zone	I-Protocol
transfer	I-Protocol
,	O
also	O
sometimes	O
known	O
by	O
the	O
inducing	O
DNS	B-Protocol
query	I-Protocol
type	O
AXFR	B-Protocol
,	O
is	O
a	O
type	O
of	O
DNS	B-Protocol
transaction	B-General_Concept
.	O
</s>
<s>
It	O
is	O
one	O
of	O
the	O
many	O
mechanisms	O
available	O
for	O
administrators	O
to	O
replicate	B-Operating_System
DNS	B-Protocol
databases	O
across	O
a	O
set	O
of	O
DNS	B-Protocol
servers	I-Protocol
.	O
</s>
<s>
A	O
zone	B-Protocol
transfer	I-Protocol
uses	O
the	O
Transmission	B-Protocol
Control	I-Protocol
Protocol	I-Protocol
(	O
TCP	O
)	O
for	O
transport	O
,	O
and	O
takes	O
the	O
form	O
of	O
a	O
client	B-Operating_System
–	I-Operating_System
server	I-Operating_System
transaction	B-General_Concept
.	O
</s>
<s>
The	O
client	O
requesting	O
a	O
zone	B-Protocol
transfer	I-Protocol
may	O
be	O
a	O
secondary	O
server	O
requesting	O
data	O
from	O
a	O
primary	O
server	O
.	O
</s>
<s>
The	O
portion	O
of	O
the	O
database	O
that	O
is	O
replicated	O
is	O
a	O
zone	B-Protocol
.	O
</s>
<s>
Zone	B-Protocol
transfer	I-Protocol
consists	O
of	O
a	O
preamble	O
,	O
followed	O
by	O
the	O
actual	O
data	O
transfer	O
.	O
</s>
<s>
The	O
preamble	O
comprises	O
a	O
lookup	O
of	O
the	O
Start	B-Protocol
of	I-Protocol
Authority	I-Protocol
(	O
SOA	O
)	O
resource	O
record	O
for	O
the	O
"	O
zone	B-Protocol
apex	O
"	O
,	O
the	O
node	O
of	O
the	O
DNS	B-Protocol
namespace	O
that	O
is	O
at	O
the	O
top	O
of	O
the	O
"	O
zone	B-Protocol
"	O
.	O
</s>
<s>
The	O
fields	O
of	O
this	O
SOA	B-Protocol
resource	I-Protocol
record	I-Protocol
,	O
in	O
particular	O
the	O
"	O
serial	O
number	O
"	O
,	O
determine	O
whether	O
the	O
actual	O
data	O
transfer	O
need	O
to	O
occur	O
at	O
all	O
.	O
</s>
<s>
The	O
client	O
compares	O
the	O
serial	O
number	O
of	O
the	O
SOA	B-Protocol
resource	I-Protocol
record	I-Protocol
with	O
the	O
serial	O
number	O
in	O
the	O
last	O
copy	O
of	O
that	O
resource	O
record	O
that	O
it	O
has	O
.	O
</s>
<s>
If	O
the	O
serial	O
number	O
of	O
the	O
record	O
being	O
transferred	O
is	O
greater	O
,	O
the	O
data	O
in	O
the	O
zone	B-Protocol
are	O
deemed	O
to	O
have	O
"	O
changed	O
"	O
(	O
in	O
some	O
fashion	O
)	O
and	O
the	O
secondary	O
proceeds	O
to	O
request	O
the	O
actual	O
zone	B-Protocol
data	O
transfer	O
.	O
</s>
<s>
If	O
the	O
serial	O
numbers	O
are	O
identical	O
,	O
the	O
data	O
in	O
the	O
zone	B-Protocol
are	O
deemed	O
not	O
to	O
have	O
"	O
changed	O
"	O
,	O
and	O
the	O
client	O
may	O
continue	O
to	O
use	O
the	O
copy	O
of	O
the	O
database	O
that	O
it	O
already	O
has	O
,	O
if	O
it	O
has	O
one	O
.	O
</s>
<s>
The	O
actual	O
data	O
transfer	O
process	O
begins	O
by	O
the	O
client	O
sending	O
a	O
query	O
(	O
opcode	O
0	O
)	O
with	O
the	O
special	O
query	O
type	O
AXFR	B-Protocol
(	O
value	O
252	O
)	O
over	O
the	O
TCP	O
connection	O
to	O
the	O
server	O
.	O
</s>
<s>
Although	O
DNS	B-Protocol
technically	O
supports	O
AXFR	B-Protocol
over	O
User	B-Protocol
Datagram	I-Protocol
Protocol	I-Protocol
(	O
UDP	O
)	O
,	O
it	O
is	O
considered	O
not	O
acceptable	O
due	O
to	O
the	O
risk	O
of	O
lost	O
,	O
or	O
spoofed	O
packets	O
.	O
</s>
<s>
The	O
server	O
responds	O
with	O
a	O
series	O
of	O
response	O
messages	O
,	O
comprising	O
all	O
of	O
the	O
resource	O
records	O
for	O
every	O
domain	O
name	O
in	O
the	O
"	O
zone	B-Protocol
"	O
.	O
</s>
<s>
The	O
first	O
response	O
comprises	O
the	O
SOA	B-Protocol
resource	I-Protocol
record	I-Protocol
for	O
the	O
zone	B-Protocol
apex	O
.	O
</s>
<s>
The	O
end	O
of	O
the	O
data	O
is	O
signaled	O
by	O
the	O
server	O
repeating	O
the	O
response	O
containing	O
the	O
SOA	B-Protocol
resource	I-Protocol
record	I-Protocol
for	O
the	O
zone	B-Protocol
apex	O
.	O
</s>
<s>
Some	O
zone	B-Protocol
transfer	I-Protocol
clients	O
perform	O
the	O
SOA	O
lookup	O
of	O
the	O
preamble	O
using	O
their	O
system	O
's	O
normal	O
DNS	B-Protocol
query	I-Protocol
resolution	O
mechanism	O
.	O
</s>
<s>
However	O
,	O
since	O
TCP	O
can	O
be	O
used	O
for	O
normal	O
DNS	B-Protocol
transactions	O
,	O
as	O
well	O
as	O
for	O
zone	B-Protocol
transfer	I-Protocol
,	O
other	O
zone	B-Protocol
transfer	I-Protocol
clients	O
perform	O
the	O
SOA	O
lookup	O
preamble	O
over	O
the	O
same	O
TCP	O
connection	O
as	O
they	O
then	O
(	O
may	O
)	O
perform	O
the	O
actual	O
data	O
transfer	O
.	O
</s>
<s>
The	O
preceding	O
describes	O
full	O
zone	B-Protocol
transfer	I-Protocol
.	O
</s>
<s>
Incremental	O
zone	B-Protocol
transfer	I-Protocol
differs	O
from	O
full	O
zone	B-Protocol
transfer	I-Protocol
in	O
the	O
following	O
respects	O
:	O
</s>
<s>
The	O
client	O
uses	O
the	O
special	O
QTYPE	O
IXFR	B-Protocol
(	O
value	O
251	O
)	O
instead	O
of	O
the	O
AXFR	B-Protocol
QTYPE	O
.	O
</s>
<s>
The	O
client	O
sends	O
the	O
SOA	B-Protocol
resource	I-Protocol
record	I-Protocol
for	O
the	O
zone	B-Protocol
apex	O
that	O
it	O
currently	O
has	O
,	O
if	O
any	O
,	O
in	O
the	O
IXFR	B-Protocol
message	O
,	O
letting	O
the	O
server	O
know	O
which	O
version	O
of	O
the	O
"	O
zone	B-Protocol
"	O
it	O
believes	O
to	O
be	O
current	O
.	O
</s>
<s>
Though	O
the	O
server	O
may	O
respond	O
in	O
the	O
normal	O
AXFR	B-Protocol
manner	O
with	O
the	O
full	O
data	O
for	O
the	O
zone	B-Protocol
,	O
it	O
may	O
also	O
instead	O
respond	O
with	O
an	O
"	O
incremental	O
"	O
data	O
transfer	O
.	O
</s>
<s>
This	O
latter	O
comprises	O
the	O
list	O
of	O
changes	O
to	O
the	O
zone	B-Protocol
data	O
,	O
in	O
zone	B-Protocol
serial	O
number	O
order	O
,	O
between	O
the	O
version	O
of	O
the	O
zone	B-Protocol
that	O
the	O
client	O
reported	O
to	O
the	O
server	O
as	O
having	O
and	O
the	O
version	O
of	O
the	O
zone	B-Protocol
that	O
is	O
current	O
at	O
the	O
server	O
.	O
</s>
<s>
Zone	B-Protocol
transfer	I-Protocol
is	O
entirely	O
client-initiated	O
.	O
</s>
<s>
Though	O
servers	O
can	O
send	O
a	O
NOTIFY	O
message	O
to	O
clients	O
(	O
that	O
they	O
have	O
been	O
informed	O
about	O
)	O
whenever	O
a	O
change	O
to	O
the	O
zone	B-Protocol
data	O
has	O
been	O
made	O
,	O
the	O
scheduling	O
of	O
zone	B-Protocol
transfers	I-Protocol
is	O
entirely	O
under	O
the	O
control	O
of	O
the	O
clients	O
.	O
</s>
<s>
Clients	O
schedule	O
zone	B-Protocol
transfers	I-Protocol
initially	O
,	O
when	O
their	O
databases	O
are	O
empty	O
,	O
and	O
thereafter	O
at	O
regular	O
intervals	O
,	O
in	O
a	O
pattern	O
controlled	O
by	O
the	O
values	O
in	O
the	O
"	O
refresh	O
"	O
,	O
"	O
retry	O
"	O
,	O
and	O
"	O
expire	O
"	O
fields	O
in	O
the	O
SOA	B-Protocol
resource	I-Protocol
record	I-Protocol
of	O
the	O
zone	B-Protocol
apex	O
.	O
</s>
<s>
Though	O
it	O
is	O
standardized	O
,	O
full-zone	O
transfer	O
being	O
described	O
as	O
one	O
of	O
the	O
possible	O
database	O
replication	O
mechanisms	O
in	O
RFC	O
1034	O
and	O
RFC	O
5936	O
(	O
incremental	O
zone	B-Protocol
transfer	I-Protocol
described	O
in	O
RFC	O
1995	O
)	O
,	O
zone	B-Protocol
transfer	I-Protocol
is	O
the	O
most	O
limited	O
of	O
those	O
database	O
replication	O
mechanisms	O
.	O
</s>
<s>
Zone	B-Protocol
transfer	I-Protocol
operates	O
in	O
terms	O
of	O
"	O
wire	B-Protocol
format	I-Protocol
"	O
resource	O
records	O
,	O
i.e.	O
</s>
<s>
resource	O
records	O
as	O
they	O
are	O
transferred	O
using	O
the	O
DNS	B-Protocol
protocol	I-Protocol
.	O
</s>
<s>
However	O
,	O
the	O
schema	O
of	O
wire	B-Protocol
format	I-Protocol
resource	O
records	O
may	O
not	O
be	O
identical	O
to	O
the	O
database	O
schema	O
used	O
by	O
the	O
back	O
ends	O
of	O
the	O
DNS	B-Protocol
servers	I-Protocol
themselves	O
.	O
</s>
<s>
The	O
preamble	O
portion	O
of	O
zone	B-Protocol
transfer	I-Protocol
relies	O
on	O
the	O
serial	O
number	O
,	O
and	O
only	O
the	O
serial	O
number	O
,	O
to	O
determine	O
whether	O
a	O
zone	B-Protocol
's	O
data	O
have	O
changed	O
,	O
and	O
thus	O
whether	O
the	O
actual	O
data	O
transfer	O
is	O
required	O
.	O
</s>
<s>
For	O
some	O
DNS	B-Protocol
server	I-Protocol
packages	O
,	O
the	O
serial	O
numbers	O
of	O
SOA	B-Protocol
resource	I-Protocol
records	I-Protocol
are	O
maintained	O
by	O
administrators	O
by	O
hand	O
.	O
</s>
<s>
Every	O
edit	O
to	O
the	O
database	O
involves	O
making	O
two	O
changes	O
,	O
one	O
to	O
the	O
record	O
being	O
changed	O
and	O
the	O
other	O
to	O
the	O
zone	B-Protocol
serial	O
number	O
.	O
</s>
<s>
RFC	O
1912	O
(	O
section	O
2.2	O
SOA	B-Protocol
records	I-Protocol
)	O
recommends	O
using	O
the	O
value	O
YYYYMMDDnn	O
as	O
the	O
number	O
(	O
YYYY	O
=	O
year	O
,	O
MM	O
=	O
month	O
,	O
DD=	O
day	O
,	O
nn	O
=	O
revision	O
number	O
)	O
.	O
</s>
<s>
Some	O
DNS	B-Protocol
server	I-Protocol
packages	O
have	O
overcome	O
this	O
problem	O
by	O
automatically	O
constructing	O
the	O
serial	O
number	O
from	O
the	O
last	O
modification	O
timestamp	O
of	O
the	O
database	O
file	O
on	O
disk	O
.	O
</s>
<s>
This	O
is	O
the	O
case	O
for	O
djbdns	B-Protocol
,	O
for	O
example	O
.	O
</s>
<s>
Furthermore	O
,	O
the	O
paradigm	O
of	O
database	O
replication	O
for	O
which	O
the	O
serial	O
number	O
check	O
(	O
and	O
indeed	O
zone	B-Protocol
transfer	I-Protocol
itself	O
)	O
is	O
designed	O
,	O
which	O
involves	O
a	O
single	O
central	O
DNS	B-Protocol
server	I-Protocol
holding	O
the	O
primary	O
version	O
of	O
the	O
database	O
with	O
all	O
other	O
DNS	B-Protocol
servers	I-Protocol
merely	O
holding	O
copies	O
,	O
simply	O
does	O
not	O
match	O
that	O
of	O
many	O
modern	O
DNS	B-Protocol
server	I-Protocol
packages	O
.	O
</s>
<s>
Modern	O
DNS	B-Protocol
server	I-Protocol
packages	O
with	O
sophisticated	O
database	O
back	O
ends	O
such	O
as	O
SQL	B-Language
servers	I-Language
and	O
Active	B-Protocol
Directory	I-Protocol
allow	O
administrators	O
to	O
make	O
updates	O
to	O
the	O
database	O
in	O
multiple	O
places	O
(	O
such	O
systems	O
employ	O
multi-master	B-Operating_System
replication	I-Operating_System
)	O
,	O
with	O
the	O
database	O
back	O
end	O
's	O
own	O
replication	O
mechanism	O
handling	O
the	O
replication	O
to	O
all	O
other	O
servers	O
.	O
</s>
<s>
This	O
paradigm	O
simply	O
does	O
not	O
match	O
that	O
of	O
a	O
single	O
,	O
central	O
,	O
monotonically	O
increasing	O
number	O
to	O
record	O
changes	O
,	O
and	O
thus	O
is	O
incompatible	O
with	O
zone	B-Protocol
transfer	I-Protocol
to	O
a	O
large	O
extent	O
.	O
</s>
<s>
Modern	O
DNS	B-Protocol
server	I-Protocol
packages	O
with	O
sophisticated	O
database	O
back	O
ends	O
often	O
will	O
create	O
a	O
"	O
shim	O
"	O
serial	O
number	O
,	O
simulating	O
the	O
existence	O
of	O
a	O
single	O
central	O
place	O
where	O
updates	O
are	O
made	O
,	O
but	O
this	O
is	O
at	O
best	O
imperfect	O
.	O
</s>
<s>
Fortunately	O
,	O
for	O
this	O
and	O
several	O
reasons	O
outlined	O
later	O
,	O
DNS	B-Protocol
servers	I-Protocol
that	O
use	O
such	O
sophisticated	O
database	O
back	O
ends	O
in	O
general	O
rarely	O
use	O
zone	B-Protocol
transfer	I-Protocol
as	O
their	O
database	O
replication	O
mechanism	O
in	O
the	O
first	O
place	O
,	O
and	O
usually	O
instead	O
employ	O
the	O
vastly	O
superior	O
distributed	B-Operating_System
database	I-Operating_System
replication	O
mechanisms	O
that	O
the	O
back	O
ends	O
themselves	O
provide	O
.	O
</s>
<s>
Serial	O
number	O
comparisons	O
are	O
intended	O
to	O
use	O
Serial	B-Protocol
Number	I-Protocol
Arithmetic	I-Protocol
as	O
defined	O
in	O
RFC	O
1982	O
.	O
</s>
<s>
However	O
,	O
this	O
is	O
inefficient	O
,	O
and	O
some	O
DNS	B-Protocol
server	I-Protocol
software	O
implemented	O
optimizations	O
,	O
geared	O
at	O
allowing	O
the	O
response	O
compression	O
mechanism	O
in	O
the	O
DNS	B-Protocol
protocol	I-Protocol
to	O
reduce	O
the	O
total	O
bandwidth	O
requirements	O
of	O
data	O
transfers	O
,	O
such	O
as	O
:	O
</s>
<s>
Several	O
DNS	B-Protocol
server	I-Protocol
packages	O
thus	O
have	O
a	O
configuration	O
setting	O
allowing	O
administrators	O
to	O
specify	O
the	O
use	O
of	O
"	O
single	O
answer	O
format	O
"	O
responses	O
for	O
those	O
clients	O
that	O
require	O
it	O
.	O
</s>
<s>
The	O
data	O
contained	O
in	O
a	O
DNS	B-Protocol
zone	I-Protocol
may	O
be	O
sensitive	O
from	O
an	O
operational	O
security	O
aspect	O
.	O
</s>
<s>
In	O
June	O
2017	O
the	O
registrar	O
responsible	O
for	O
Russian	O
top-level-domains	O
accidentally	O
enabled	O
DNS	B-Protocol
zone	I-Protocol
transfers	I-Protocol
via	O
AXFR	B-Protocol
which	O
led	O
to	O
5.6	O
million	O
records	O
being	O
accidentally	O
exposed	O
.	O
</s>
<s>
In	O
2008	O
a	O
court	O
in	O
North	O
Dakota	O
,	O
USA	O
,	O
ruled	O
that	O
performing	O
a	O
zone	B-Protocol
transfer	I-Protocol
as	O
an	O
unauthorized	O
outsider	O
to	O
obtain	O
information	O
that	O
was	O
not	O
publicly	O
accessible	O
constitutes	O
a	O
violation	O
of	O
North	O
Dakota	O
law	O
.	O
</s>
