Adguardhome: Match CNAME records against the blocklists

Created on 20 Nov 2019  ·  3Comments  ·  Source: AdguardTeam/AdGuardHome

Check out the original issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/780

Here's what we should do:

  1. Match CNAME records against the blocklists
  2. Indicate in the query log that the response was blocked by matching a CNAME. It'd be ideal if we print the original response there as well.
  3. Please note, that if there's an exception rule matching the DNS query's question, you should not check the CNAME.

Additionally to implementing this in AdGuard Home, we should do the following:

  1. [x] Update the dnsproxy's mobile API
  2. [x] Update AdGuard DNS to do this as well
  3. [x] File a feature request to github.com/AdguardTeam/DnsLibs
Medium enhancement

Most helpful comment

@hoshsadiq all CNAME records in the chain will be present in the recursor's response so this is not a problem:

$ nslookup test2.meshkov.info
Server:     2001:db8:7c02:1::1
Address:    2001:db8:7c02:1::1#53

Non-authoritative answer:
test2.meshkov.info  canonical name = test1.meshkov.info.
test1.meshkov.info  canonical name = example.org.
Name:   example.org
Address: 93.184.216.34

All 3 comments

Just in case the following is overlooked.. It would be good if this goes through the whole CNAME chain. I.e.

ad.firstparty.com cname unblocked.company2.com
unblocked.company2.com cname blocked.adcompany.com
blocked.adcompany.com

This request should be blocked if either unblocked.company2.com or blocked.adcompany.com is blocked.

@hoshsadiq all CNAME records in the chain will be present in the recursor's response so this is not a problem:

$ nslookup test2.meshkov.info
Server:     2001:db8:7c02:1::1
Address:    2001:db8:7c02:1::1#53

Non-authoritative answer:
test2.meshkov.info  canonical name = test1.meshkov.info.
test1.meshkov.info  canonical name = example.org.
Name:   example.org
Address: 93.184.216.34

Aah! Perfect!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  ·  4Comments

ameshkov picture ameshkov  ·  3Comments

yanniedog picture yanniedog  ·  3Comments

ammnt picture ammnt  ·  3Comments

s-timm picture s-timm  ·  4Comments