<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<br>
Seems pretty clear now. <br>
<br>
I'm not interested into making redirect visible in public queries,
so I suppose I'll go for the most standard one<br>
<br>
<blockquote type="cite">@ SOA ...<br>
@ NS ...<br>
@ MX ...<br>
@ ALIAS <i><b>webhost.servername.tld.</b></i><i><b></b></i><br>
www A 192.0.2.1<br>
www AAAA 2001:db8::1</blockquote>
<br>
considering that this dns server is authoritative for <i><b>webhost.servername.tld</b></i>
it seems the simplest way to achieve my goal to standardize a
template for any new domain with same structure.<br>
<br>
Many thanks for your time Brian, very appreciated!<br>
<br>
Andrea<br>
<br>
<br>
<div class="moz-cite-prefix">Il 23/01/2023 13:21, Brian Candler ha
scritto:<br>
</div>
<blockquote type="cite"
cite="mid:a54a06c8-8762-c66b-9963-a66816e19edc@pobox.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">On 23/01/2023 12:10, Andrea
Biancalani wrote:<br>
</div>
<blockquote type="cite"
cite="mid:b150f553-ce6e-7b9f-e760-c2c435a4be5c@conmet.it">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<br>
my default template for new hosting is similar to this<br>
<br>
<blockquote type="cite">@ SOA ...<br>
@ NS ...<br>
@ MX ...<br>
@ A 192.0.2.1<br>
@ AAAA 2001:db8::1<br>
www A 192.0.2.1<br>
www AAAA 2001:db8::1</blockquote>
<br>
but if I try to use this template<br>
<br>
<blockquote type="cite">@ SOA ...<br>
@ NS ...<br>
@ MX ...<br>
@ ALIAS www. <i><b>(added final dot)</b></i><br>
www A 192.0.2.1<br>
www AAAA 2001:db8::1</blockquote>
<br>
I can resolve the <a class="moz-txt-link-abbreviated"
href="http://www.foo.bar" moz-do-not-send="true">www.foo.bar</a>
record, but when trying to resolve foo.bar I get a "Server
failed" answer ( dns-server is not able to find foo.bar)<br>
</blockquote>
<p>That is as expected. If you add the final dot to www, then you
are forcing it to resolve the top-level name, literally just
"www" (not "<a class="moz-txt-link-abbreviated"
href="http://www.foo.bar" moz-do-not-send="true">www.foo.bar</a>"),
which of course does not exist.<br>
</p>
<p>If this were a BIND zonefile, then "www" without the dot would
have the current domain appended implicitly. I haven't tried
this with PDNS.</p>
<p>Also, alias records only work if you've configured pdns-auth
with a resolver to be able to look them up.</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:b150f553-ce6e-7b9f-e760-c2c435a4be5c@conmet.it"> <br>
Trying to use a template like this instead, gave as result a "<span
style="color: rgb(255, 255, 255); font-family: "Source
Sans Pro", "Helvetica Neue", Helvetica, Arial,
sans-serif; font-size: 14px; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(221, 75,
57); text-decoration-thickness: initial;
text-decoration-style: initial; text-decoration-color:
initial; display: inline !important; float: none;">RRset
foo.bar. IN CNAME: Conflicts with pre-existing RRset</span>"<br>
<br>
<blockquote type="cite">@ SOA ...<br>
@ NS ...<br>
@ MX ...<br>
@ CNAME www. <i><b>(added final dot)</b></i><br>
www A 192.0.2.1<br>
www AAAA 2001:db8::1</blockquote>
<br>
</blockquote>
<p>That is forbidden by the RFCs. A CNAME cannot exist at the same
position in the DNS tree as any other records: in your case
above, you have SOA, NS and MX records with the same label,
which conflict with it.<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:b150f553-ce6e-7b9f-e760-c2c435a4be5c@conmet.it"> that
doesn't happens if I use the zone record as target of the CNAME<br>
<br>
<blockquote type="cite">@ SOA ...<br>
@ NS ...<br>
@ MX ...<br>
@ CNAME foo.bar. <i><b>(added final dot)</b></i><br>
www A 192.0.2.1<br>
www AAAA 2001:db8::1</blockquote>
</blockquote>
<p>That should give the same error - it doesn't make any
difference what the target of the CNAME is - except if the
domain in question is foo.bar, then you have a CNAME from
foo.bar pointing to foo.bar, which is meaningless anyway. It may
have been silently discarded.<br>
</p>
</blockquote>
<br>
</body>
</html>