Is DHT supported in aria2 for trackerless torrents?
Yes, aria2 fully supports Distributed Hash Table (DHT) functionality, enabling users to download trackerless torrents and magnet links without needing a centralized tracker. This feature allows the command-line utility to discover peers directly through a decentralized network. By default, aria2 enables IPv4 DHT automatically, but it requires specific configuration parameters if you need to utilize IPv6 DHT or resolve bootstrapping connectivity issues.
Enabling and Configuring DHT in aria2
While aria2 handles trackerless torrents out of the box, understanding its specific command-line flags helps ensure optimal performance and connectivity across different network environments.
--enable-dht: This option controls IPv4 DHT functionality and is set totrueby default. It also enables UDP tracker support. If you ever need to troubleshoot or ensure it is active, you can explicitly pass--enable-dht=true.--enable-dht6: Unlike the IPv4 counterpart, IPv6 DHT is disabled by default. If your network environment relies on IPv6, you must explicitly enable it by adding--enable-dht6=trueto your command.--dht-listen-port: Specifies the UDP listening port used by both DHT and UDP trackers. The default range is6881-6999. Ensuring these ports are open on your router or firewall is crucial for receiving incoming peer requests.
The Importance of DHT Bootstrapping
When downloading a completely trackerless torrent (such as a raw magnet link) for the very first time, aria2 may occasionally struggle to find peers if its internal routing table is empty. Because aria2 does not ship with a hardcoded list of public bootstrap nodes, it normally learns about the DHT network dynamically while downloading standard torrents that include working HTTP or UDP trackers.
If aria2 fails to resolve a trackerless torrent on a fresh installation, you can manually guide it to a public bootstrap node using the following option:
--dht-entry-point=<HOST>:<PORT>
For example, routing your initial connection through a well-known public endpoint can jumpstart the peer discovery process:
aria2c --dht-entry-point=dht.transmissionbt.com:6881 "magnet:?xt=urn:btih:..."
Important Exceptions: Private Torrents
It is critical to note that aria2 strictly respects the
private flag embedded within specific torrent files. If a
torrent is flagged as private by its creator, aria2 will automatically
disable DHT and Peer Exchange (PEX) for that specific download, even if
--enable-dht is globally set to true. This intentional
behavior prevents private swarm keys and statistics from leaking onto
public decentralized networks.