Seems pretty clear now.
I'm not interested into making redirect visible in public queries, so I
suppose I'll go for the most standard one
@ SOA ...
@ NS ...
@ MX ...
@ ALIAS /*webhost.servername.tld.*//**/
www A 192.0.2.1
www AAAA 2001:db8::1
considering that this dns server is authoritative for
/*webhost.servername.tld*/ it seems the simplest way to achieve my goal
to standardize a template for any new domain with same structure.
Many thanks for your time Brian, very appreciated!
Andrea
Il 23/01/2023 13:21, Brian Candler ha scritto:
On 23/01/2023 12:10, Andrea Biancalani wrote:
my default template for new hosting is similar to this
@ SOA ...
@ NS ...
@ MX ...
@ A 192.0.2.1
@ AAAA 2001:db8::1
www A 192.0.2.1
www AAAA 2001:db8::1
but if I try to use this template
@ SOA ...
@ NS ...
@ MX ...
@ ALIAS www. /*(added final dot)*/
www A 192.0.2.1
www AAAA 2001:db8::1
I can resolve the www.foo.bar record, but when trying to resolve
foo.bar I get a "Server failed" answer ( dns-server is not able to
find foo.bar)
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
"www.foo.bar"), which of course does not exist.
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.
Also, alias records only work if you've configured pdns-auth with a
resolver to be able to look them up.
Trying to use a template like this instead, gave as result a "RRset
foo.bar. IN CNAME: Conflicts with pre-existing RRset"
@ SOA ...
@ NS ...
@ MX ...
@ CNAME www. /*(added final dot)*/
www A 192.0.2.1
www AAAA 2001:db8::1
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.
that doesn't happens if I use the zone record as target of the CNAME
@ SOA ...
@ NS ...
@ MX ...
@ CNAME foo.bar. /*(added final dot)*/
www A 192.0.2.1
www AAAA 2001:db8::1
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.
_______________________________________________
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
https://mailman.powerdns.com/mailman/listinfo/pdns-users