No subject

Felipe Gasper felipe at felipegasper.com
Mon Jun 6 14:09:50 UTC 2022


> On Jun 6, 2022, at 09:57, Dimitris Chryssanthakopoulos via Unbound-users <unbound-users at lists.nlnetlabs.nl> wrote:
> 
> Dear Unbound-Users,
> 
> 
> I am trying to do with Unbound what NextDNS calls "CNAME Flattening":
> 
>  - when a request is made for a public host I want an A record for that name, even if 
> strictly speaking it is a CNAME. Is that possible with the available settings?
> 
> To avoid confusion, Unbound may chase the CNAME chain properly (to avoid
> poisoning etc) but it must reply to the original requestor only with an A
> record.

CNAME flattening is how libunbound always works, as far as I can tell: when you request an A record, Unbound will internally resolve all CNAME records.

For example, “www.felipegasper.com”’s CNAME is “felipegasper.com”. When I query for CNAMEs, I get the CNAME:

> perl -MDNS::Unbound -E'say join ".", unpack "(C/a)*" for DNS::Unbound->new()->resolve("www.felipegasper.com", "CNAME")->data()->@*'
felipegasper.com.

When I query for A records, though, I just get IPs:

> perl -MDNS::Unbound -E'say join ".", unpack "C*" for DNS::Unbound->new()->resolve("www.felipegasper.com", "A")->data()->@*'
172.241.25.87

-FG


More information about the Unbound-users mailing list