[Pdns-users] Creating a www CNAME in powerDNS Admin (mysql backend) automatically pointing to @
Brian Candler
b.candler at pobox.com
Mon Jan 23 12:21:59 UTC 2023
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20230123/151e1144/attachment.htm>
More information about the Pdns-users
mailing list