The author describes creating a DNS sinkhole using an ESP32 microcontroller to combat doomscrolling. By intercepting DNS requests on their local network and redirecting specific domains (like social media sites) to a local web server, they effectively block access to these sites. The ESP32 runs a custom DNS server that returns a pre-defined IP address for targeted domains, leading devices to a blank webpage hosted on the ESP32 itself. This allows the author to curtail time spent on distracting websites without relying on browser extensions or more complex network configurations.
The blog post "Turning my ESP32 into a DNS sinkhole to fight doomscrolling" details the author's journey to curtail their unproductive habit of excessive social media consumption using a low-power, WiFi-enabled microcontroller, the ESP32. The author posits that by intercepting and redirecting DNS requests for specific social media domains, they can effectively block access to these platforms on their local network, thus reducing the temptation to doomscroll.
The implementation hinges on the ESP32's ability to function as a captive portal, a technique commonly employed by public Wi-Fi hotspots to require users to log in. The ESP32 mimics a legitimate DNS server, intercepting requests from devices on the network. When a device attempts to resolve the domain name of a targeted social media site, the ESP32 responds with a pre-configured IP address, effectively redirecting the device to a different location. Instead of connecting to the intended social media platform, the device is redirected to a locally hosted "block page" served by the ESP32 itself. This block page informs the user that the site is blocked and serves as a gentle reminder to avoid doomscrolling.
The author outlines the technical steps involved in setting up the ESP32 for this purpose, including installing the necessary software libraries, configuring the captive portal functionality, and defining the list of targeted domains to be blocked. The author chose to leverage the Arduino IDE for programming the ESP32 and provides snippets of the code used for the project, including how to configure the DNS server, handle DNS requests, and set up the captive portal. They specifically used the DNSServer library to simplify DNS manipulation.
The author further explains the limitations of this approach, acknowledging that a determined user could circumvent the block by manually changing their DNS settings. However, the author argues that the inherent friction introduced by this process is sufficient to deter casual doomscrolling. The goal isn't foolproof blocking, but rather to introduce a pause, a moment of reflection, that disrupts the automatic habit of reaching for social media.
Finally, the author highlights the benefits of using an ESP32 for this task, emphasizing its low power consumption and relatively straightforward programming environment. They also touch upon the project's potential for customization, allowing users to tailor the blocked domains and the content of the block page to their specific needs and preferences. This DIY approach offers a personalized and adaptable solution for managing online habits, specifically targeted at reducing the negative impact of excessive social media consumption.
Summary of Comments ( 9 )
https://news.ycombinator.com/item?id=43204091
Hacker News users generally praised the project's simplicity and effectiveness for blocking distracting websites. Several commenters suggested improvements, such as using a pre-built DNS sinkhole list or implementing a local DNS server for better performance. Some discussed the ethics and potential downsides of blocking websites, particularly for families or in situations where access is necessary. Others offered alternative solutions, like using Pi-hole or modifying the hosts file. A few pointed out potential issues with the ESP32's limited resources and the importance of using a reliable power supply. The overall sentiment was positive, viewing the project as a clever, albeit somewhat limited, solution to a common problem.
The Hacker News post "Turning my ESP32 into a DNS sinkhole to fight doomscrolling" generated a moderate number of comments, mostly focusing on the practicality and efficacy of the approach, as well as alternative solutions.
Several commenters questioned the effectiveness of using an ESP32 for this purpose, citing its limited resources and potential performance bottlenecks. One commenter pointed out that DNS queries are generally small and infrequent, suggesting the ESP32 might be sufficient for a home network. Another countered this by highlighting the ESP32's relatively slow processing speed and limited RAM, which could become problematic with more devices or complex DNS configurations. The potential for latency issues and single point of failure were also raised as concerns.
A prominent thread discussed alternative methods for achieving the same goal, such as using a Pi-hole, modifying the hosts file, or utilizing features built into existing routers. Pi-hole was frequently mentioned as a more robust and feature-rich solution, already designed for network-wide ad blocking and DNS sinkholing. Modifying the hosts file was suggested as a simpler, though potentially less manageable, alternative for individual devices. Some commenters highlighted the built-in DNS filtering options available in certain routers, offering a convenient solution without requiring additional hardware.
Some users discussed the broader implications of DNS sinkholing, including the ethical considerations of blocking content and the potential for inadvertently breaking legitimate websites. One commenter argued that while the author's intentions were understandable, blocking entire domains might be overly aggressive, suggesting a more targeted approach to filtering specific unwanted content.
While generally receptive to the author's ingenuity, the overall sentiment in the comments leans towards exploring alternative, more established solutions for DNS sinkholing and content filtering. The ESP32 approach is acknowledged as a functional proof-of-concept, but its limitations and potential drawbacks are highlighted, leading to recommendations for more robust and scalable alternatives. The discussion also extends to the ethical considerations surrounding content blocking and the importance of carefully considering the implications of such practices.