<s>
A	O
Canonical	O
Name	O
(	O
CNAME	B-Protocol
)	O
record	O
is	O
a	O
type	O
of	O
resource	O
record	O
in	O
the	O
Domain	B-Protocol
Name	I-Protocol
System	I-Protocol
(	O
DNS	B-Protocol
)	O
that	O
maps	O
one	O
domain	O
name	O
(	O
an	O
alias	O
)	O
to	O
another	O
(	O
the	O
canonical	O
name	O
)	O
.	O
</s>
<s>
This	O
can	O
prove	O
convenient	O
when	O
running	O
multiple	O
services	O
(	O
like	O
an	O
FTP	B-Protocol
server	I-Protocol
and	O
a	O
web	B-Application
server	I-Application
,	O
each	O
running	O
on	O
different	O
ports	O
)	O
from	O
a	O
single	O
IP	O
address	O
.	O
</s>
<s>
One	O
can	O
,	O
for	O
example	O
,	O
use	O
CNAME	B-Protocol
records	I-Protocol
to	O
point	O
ftp.example.com	O
and	O
www.example.com	O
to	O
the	O
DNS	B-Protocol
entry	O
for	O
example.com,	O
which	O
in	O
turn	O
has	O
an	O
A	B-Protocol
record	I-Protocol
which	O
points	O
to	O
the	O
IP	O
address	O
.	O
</s>
<s>
Then	O
,	O
if	O
the	O
IP	O
address	O
ever	O
changes	O
,	O
one	O
only	O
has	O
to	O
record	O
the	O
change	O
in	O
one	O
place	O
within	O
the	O
network	O
:	O
in	O
the	O
DNS	B-Protocol
A	B-Protocol
record	I-Protocol
for	O
example.com	O
.	O
</s>
<s>
CNAME	B-Protocol
records	I-Protocol
must	O
always	O
point	O
to	O
another	O
domain	O
name	O
,	O
never	O
directly	O
to	O
an	O
IP	O
address	O
.	O
</s>
<s>
DNS	B-Protocol
CNAME	B-Protocol
records	I-Protocol
are	O
specified	O
in	O
RFC	O
1034	O
and	O
clarified	O
in	O
Section	O
10	O
of	O
RFC	O
2181	O
.	O
</s>
<s>
CNAME	B-Protocol
records	I-Protocol
are	O
handled	O
specially	O
in	O
the	O
domain	B-Protocol
name	I-Protocol
system	I-Protocol
,	O
and	O
have	O
several	O
restrictions	O
on	O
their	O
use	O
.	O
</s>
<s>
When	O
a	O
DNS	B-Protocol
resolver	O
encounters	O
a	O
CNAME	B-Protocol
record	I-Protocol
while	O
looking	O
for	O
a	O
regular	O
resource	O
record	O
,	O
it	O
will	O
restart	O
the	O
query	O
using	O
the	O
canonical	O
name	O
instead	O
of	O
the	O
original	O
name	O
.	O
</s>
<s>
(	O
If	O
the	O
resolver	O
is	O
specifically	O
told	O
to	O
look	O
for	O
CNAME	B-Protocol
records	I-Protocol
,	O
the	O
canonical	O
name	O
(	O
right-hand	O
side	O
)	O
is	O
returned	O
,	O
rather	O
than	O
restarting	O
the	O
query	O
.	O
)	O
</s>
<s>
The	O
canonical	O
name	O
that	O
a	O
CNAME	B-Protocol
record	I-Protocol
points	O
to	O
can	O
be	O
anywhere	O
in	O
the	O
DNS	B-Protocol
,	O
whether	O
local	O
or	O
on	O
a	O
remote	O
server	O
in	O
a	O
different	O
DNS	B-Protocol
zone	I-Protocol
.	O
</s>
<s>
For	O
example	O
,	O
if	O
there	O
is	O
a	O
DNS	B-Protocol
zone	I-Protocol
as	O
follows	O
:	O
</s>
<s>
CNAME	B-Protocol
foo.example.com	O
.	O
</s>
<s>
when	O
an	O
A	B-Protocol
record	I-Protocol
lookup	O
for	O
bar.example.com	O
is	O
carried	O
out	O
,	O
the	O
resolver	O
will	O
see	O
a	O
CNAME	B-Protocol
record	I-Protocol
and	O
restart	O
the	O
checking	O
at	O
foo.example.com	O
and	O
will	O
then	O
return	O
192.0.2.23	O
.	O
</s>
<s>
With	O
a	O
CNAME	B-Protocol
record	I-Protocol
,	O
one	O
can	O
point	O
a	O
name	O
such	O
as	O
"	O
bar.example.com	O
 "	O
to	O
"	O
foo.example.com	O
.	O
"	O
</s>
<s>
(	O
left-hand	O
)	O
side	O
of	O
a	O
DNS	B-Protocol
entry	O
can	O
be	O
incorrectly	O
identified	O
as	O
"	O
the	O
CNAME	B-Protocol
"	O
or	O
"	O
a	O
CNAME.	O
"	O
</s>
<s>
Because	O
CNAME	B-Protocol
stands	O
for	O
Canonical	O
Name	O
,	O
the	O
right-hand	O
side	O
is	O
the	O
actual	O
"	O
CNAME	B-Protocol
"	O
;	O
on	O
the	O
same	O
side	O
as	O
the	O
address	O
"	O
A	O
"	O
.	O
</s>
<s>
This	O
confusion	O
is	O
specifically	O
mentioned	O
in	O
RFC	O
2181	O
,	O
"	O
Clarifications	O
to	O
the	O
DNS	B-Protocol
Specification.	O
"	O
</s>
<s>
In	O
other	O
words	O
,	O
a	O
CNAME	B-Protocol
record	I-Protocol
like	O
this	O
:	O
</s>
<s>
CNAME	B-Protocol
foo.example.com	O
.	O
</s>
<s>
bar.example.com	O
is	O
an	O
alias	O
for	O
the	O
canonical	O
name	O
(	O
CNAME	B-Protocol
)	O
foo.example.com	O
.	O
</s>
<s>
In	O
contrast	O
,	O
the	O
CNAME	B-Protocol
record	I-Protocol
creates	O
an	O
alias	O
for	O
a	O
single	O
name	O
and	O
not	O
its	O
subdomains	O
.	O
</s>
<s>
Like	O
the	O
CNAME	B-Protocol
record	I-Protocol
,	O
the	O
DNS	B-Protocol
lookup	O
will	O
continue	O
by	O
retrying	O
the	O
lookup	O
with	O
the	O
new	O
name	O
.	O
</s>
<s>
The	O
name	O
server	O
synthesizes	O
a	O
CNAME	B-Protocol
record	I-Protocol
to	O
actually	O
apply	O
the	O
DNAME	O
record	O
to	O
the	O
requested	O
name	O
—	O
CNAMEs	B-Protocol
for	O
every	O
node	O
on	O
a	O
subtree	O
have	O
the	O
same	O
effect	O
as	O
a	O
DNAME	O
for	O
the	O
entire	O
subtree	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
there	O
is	O
a	O
DNS	B-Protocol
zone	I-Protocol
as	O
follows	O
:	O
</s>
<s>
An	O
A	B-Protocol
record	I-Protocol
lookup	O
for	O
foo.example.com	O
will	O
return	O
no	O
data	O
because	O
a	O
DNAME	O
is	O
not	O
a	O
CNAME	B-Protocol
and	O
there	O
is	O
no	O
A	B-Protocol
record	I-Protocol
directly	O
at	O
foo	O
.	O
</s>
<s>
However	O
,	O
a	O
lookup	O
for	O
xyzzy.foo.example.com	O
will	O
be	O
DNAME	O
mapped	O
and	O
return	O
the	O
A	B-Protocol
record	I-Protocol
for	O
xyzzy.bar.example.com,	O
which	O
is	O
192.0.2.24	O
;	O
if	O
the	O
DNAME	O
record	O
had	O
been	O
a	O
CNAME	B-Protocol
record	I-Protocol
,	O
this	O
request	O
would	O
have	O
returned	O
name	O
not	O
found	O
.	O
</s>
<s>
Several	O
managed	O
DNS	B-Protocol
platforms	O
implement	O
a	O
non-standard	O
ALIAS	O
or	O
ANAME	O
record	O
type	O
.	O
</s>
<s>
These	O
pseudo	O
records	O
are	O
managed	O
by	O
DNS	B-Protocol
administrators	O
like	O
CNAME	B-Protocol
records	I-Protocol
,	O
but	O
are	O
published	O
and	O
resolved	O
by	O
(	O
some	O
)	O
DNS	B-Protocol
clients	O
like	O
A	B-Protocol
records	I-Protocol
.	O
</s>
<s>
While	O
ANAME	O
record	O
types	O
was	O
submitted	O
for	O
standardization	O
,	O
there	O
are	O
other	O
non-conforming	O
implementations	O
,	O
so	O
they	O
can	O
do	O
whatever	O
the	O
owner	O
of	O
the	O
DNS	B-Protocol
platform	O
chooses	O
,	O
including	O
existing	O
at	O
the	O
apex	O
of	O
a	O
zone	O
and	O
existing	O
for	O
domains	O
that	O
receive	O
mail	O
.	O
</s>
<s>
Main	O
advantage	O
of	O
ANAME	O
records	O
over	O
CNAME	B-Protocol
records	I-Protocol
is	O
that	O
it	O
can	O
be	O
used	O
on	O
zone	O
apex	O
,	O
while	O
standard-following	O
resolver	O
will	O
not	O
tread	O
domain	O
name	O
with	O
CNAME	B-Protocol
record	I-Protocol
as	O
zone	O
apex	O
.	O
</s>
<s>
Also	O
,	O
while	O
a	O
DNS	B-Protocol
client	O
requires	O
at	O
least	O
two	O
queries	O
to	O
resolve	O
a	O
CNAME	B-Protocol
to	O
an	O
A	B-Protocol
record	I-Protocol
to	O
an	O
IP	O
address	O
,	O
having	O
ANAME	O
will	O
shift	O
the	O
second	O
and	O
subsequent	O
query	O
to	O
the	O
server	O
.	O
</s>
<s>
If	O
the	O
DNS	B-Protocol
server	O
can	O
resolve	O
the	O
A	B-Protocol
record	I-Protocol
and	O
cache	O
the	O
requested	O
IP	O
address	O
more	O
efficiently	O
and	O
with	O
less	O
latency	O
than	O
its	O
DNS	B-Protocol
clients	O
can	O
,	O
then	O
the	O
DNS	B-Protocol
client	O
can	O
get	O
the	O
resolution	O
faster	O
.	O
</s>
