# CNAME cloaking

> Technique to escape ad-blockers through CNAME aliases and disguise third-party trackers as first-parties

**Wikidata**: [Q108046961](https://www.wikidata.org/wiki/Q108046961)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/CNAME_cloaking)  
**Source**: https://4ort.xyz/entity/cname-cloaking

## Summary
CNAME cloaking is a web tracking technique used to bypass ad-blockers by disguising third-party trackers as first-party domains. It operates by utilizing CNAME aliases, allowing tracking requests to appear as legitimate, first-party network traffic.

## Key Facts
- **Definition**: A technique to escape ad-blockers through CNAME aliases and disguise third-party trackers as first-parties.
- **Parent Class**: Subclass of **web tracking** (specifically identified as a related technique to ad tracking).
- **Aliases**: Also known as DNS Delegation, DNS Aliasing, and CNAME cloaking-based tracking.
- **Wikipedia Coverage**: Available in 2 languages (German, English).
- **Technical Description**: Described by WebKit as a method to "escape ad-blockers" and by APNIC as "CNAME cloaking-based tracking."
- **Countermeasure**: The uBlock Origin extension includes a setting called "Uncloak canonical names" to detect and block this technique.

## FAQs
### Q: How does CNAME cloaking bypass ad-blockers?
A: It disguises third-party trackers as first-party hosts by using CNAME records in the DNS. This makes tracking requests appear to originate from the website's own domain, allowing them to evade standard third-party blocking filters.

### Q: What sources define CNAME cloaking?
A: The technique is formally described by WebKit in their documentation on "CNAME Cloaking and Bounce Tracking Defense" and by APNIC in their analysis "Characterizing CNAME cloaking-based tracking."

### Q: Can ad-blockers defend against CNAME cloaking?
A: Yes, advanced tools like uBlock Origin offer specific defenses. The software includes a privacy setting titled "Uncloak canonical names" designed to reveal the true destination of these disguised tracking requests.

## Why It Matters
CNAME cloaking represents a significant evolution in tracking technology that directly undermines user privacy tools. By exploiting the DNS layer to masquerade third-party trackers as first-party resources, it allows data collectors to circumvent standard ad-blocking filters that rely on domain lists. This technique forces privacy advocates and browser developers to develop more sophisticated countermeasures, such as uncloaking canonical names, to maintain user control over data. Its existence highlights the ongoing "arms race" between web trackers and privacy protection tools.

## Notable For
- **Evasion Capability**: Specifically designed to escape ad-blockers by exploiting DNS CNAME records.
- **Disguise Method**: Effectively disguises third-party trackers as first-parties, making network traffic appear local to the website.
- **Industry Recognition**: Identified by major technical bodies like WebKit and APNIC as a distinct and problematic tracking method.
- **Countermeasure Development**: Notable for prompting specific defensive features in privacy tools, such as the "Uncloak canonical names" setting in uBlock Origin.

## Body
### Technical Mechanism
CNAME cloaking functions by manipulating the Domain Name System (DNS). Typically, ad-blockers filter requests based on the domain name of the third-party tracker. In this technique, a website operator configures a subdomain (e.g., `tracker.example.com`) to point to a third-party tracking service via a CNAME record. To the browser and basic ad-blocker, the request appears as a first-party request to `example.com`, but the DNS resolution redirects it to the third-party tracker, effectively bypassing blocklists.

### Relationship to Web Tracking
CNAME cloaking is a specific subclass and technique within the broader practice of **web tracking**. While web tracking encompasses various methods like cross-device tracking and cookie syncing, CNAME cloaking specifically targets the DNS resolution process to facilitate data collection. It is categorized as a form of "ad tracking" within the web tracking ecosystem.

### Documentation and Sources
The technique is well-documented by key technical organizations:
- **WebKit**: In a blog post titled "CNAME Cloaking and Bounce Tracking Defense" (dated 2020-11-12), WebKit defines the technique and discusses browser defenses.
- **APNIC**: The organization published an article titled "Characterizing CNAME cloaking-based tracking" (dated 2020-08-04), analyzing the prevalence and mechanics of the method.
- **uBlock Origin**: The project's wiki documents the technique under "Uncloak canonical names" in the Dashboard Settings pane, providing a specific tool for users to mitigate it.

### Terminology and Identifiers
The concept is referred to by several names in technical and academic contexts, including "DNS Delegation," "DNS Aliasing," and "CNAME cloaking-based tracking." It is recorded in Wikidata with the description "Technique to escape ad-blockers through CNAME aliases and disguise third-party trackers as first-parties." Wikipedia coverage is limited to German and English editions.

## References

1. [Source](https://webkit.org/blog/11338/cname-cloaking-and-bounce-tracking-defense)
2. [Source](https://blog.apnic.net./2020/08/04/characterizing-cname-cloaking-based-tracking)
3. [Source](https://github.com./gorhill/uBlock/wiki/Dashboard:-Settings#uncloak-canonical-names)